concptr ANGBAND_DIR_DATA; //!< Binary image files for the "*_info" arrays (binary) These files are not portable between platforms
concptr ANGBAND_DIR_EDIT; //!< Textual template files for the "*_info" arrays (ascii) These files are portable between platforms
concptr ANGBAND_DIR_SCRIPT; //!< Script files These files are portable between platforms.
+concptr ANGBAND_DIR_FILE; //!< Various extra files (ascii) These files may be portable between platforms
concptr ANGBAND_DIR_HELP; //!< Help files (normal) for the online help (ascii) These files are portable between platforms
concptr ANGBAND_DIR_INFO; //!< Help files (spoilers) for the online help (ascii) These files are portable between platforms
concptr ANGBAND_DIR_PREF; //!< Default user "preference" files (ascii) These files are rarely portable between platforms
/*!
* @brief 墓のアスキーアートテンプレを読み込む
* @param buf テンプレへのバッファ
+ * @param buf_size バッファの長さ
* @return なし
*/
-void read_dead_file(char *buf)
+void read_dead_file(char *buf, size_t buf_size)
{
- path_build(buf, sizeof(buf), ANGBAND_DIR_FILE, _("dead_j.txt", "dead.txt"));
+ path_build(buf, buf_size, ANGBAND_DIR_FILE, _("dead_j.txt", "dead.txt"));
FILE *fp;
fp = my_fopen(buf, "r");
if (!fp) return;
int i = 0;
- while (my_fgets(fp, buf, sizeof(buf)) == 0)
+ while (my_fgets(fp, buf, buf_size) == 0)
{
put_str(buf, i++, 0);
}
extern void do_cmd_save_and_exit(player_type *player_ptr);
extern void exit_game_panic(player_type *creature_ptr);
extern errr get_rnd_line(concptr file_name, int entry, char *output);
-void read_dead_file(char* buf);
+void read_dead_file(char* buf, size_t buf_size);
#ifdef JP
extern errr get_rnd_line_jonly(concptr file_name, int entry, char *output, int count);
#define GRAVE_LINE_WIDTH 31
-concptr ANGBAND_DIR_FILE; //!< Various extra files (ascii) These files may be portable between platforms
-
/*!
* @brief 墓石の真ん中に文字列を書き込む /
* Centers a string within a GRAVE_LINE_WIDTH character string -JWT-
* @param buf 墓テンプレへのバッファ
* @return 追加の行数
*/
-static int show_killing_monster(player_type *dead_ptr, char *buf)
+static int show_killing_monster(player_type *dead_ptr, char *buf, char *tmp)
{
- char tmp[160];
- roff_to_buf(dead_ptr->died_from, GRAVE_LINE_WIDTH + 1, tmp, sizeof tmp);
+ roff_to_buf(dead_ptr->died_from, GRAVE_LINE_WIDTH + 1, tmp, sizeof(tmp));
char *t;
t = tmp + strlen(tmp) + 1;
if (!*t) return 0;
* @param creature_ptr プレーヤーへの参照ポインタ
* @return なし
*/
-void print_tomb(player_type *dead_ptr, void(*read_dead_file)(char*))
+void print_tomb(player_type *dead_ptr, void(*read_dead_file)(char*, size_t))
{
Term_clear();
char buf[1024];
- (*read_dead_file)(buf);
-
+ (*read_dead_file)(buf, sizeof(buf));
concptr p = (current_world_ptr->total_winner || (dead_ptr->lev > PY_MAX_LEVEL))
? _("偉大なる者", "Magnificant")
: player_title[dead_ptr->pclass][(dead_ptr->lev - 1) / 5];
}
else
{
- extra_line = show_killing_monster(dead_ptr, buf);
+ extra_line = show_killing_monster(dead_ptr, buf, tmp);
}
center_string(buf, tmp);
#include "angband.h"
-void print_tomb(player_type *dead_ptr, void(*read_dead_file)(char*));
+void print_tomb(player_type *dead_ptr, void(*read_dead_file)(char*, size_t));
void show_info(player_type *creature_ptr, void(*handle_stuff)(player_type*), errr(*file_character)(player_type*, concptr), void(*update_playtime)(void), void(*displayer_player)(player_type*, int));