From 5354fd7af0b68629c2944eee2ffb0c3e97019fb6 Mon Sep 17 00:00:00 2001 From: shimitei Date: Sun, 16 May 2021 09:28:49 +0900 Subject: [PATCH] =?utf8?q?[Fix]=20=E9=95=B7=E3=81=84=E3=83=9E=E3=82=AF?= =?utf8?q?=E3=83=AD=E3=81=8C=E7=99=BB=E9=8C=B2=E3=81=95=E3=82=8C=E3=81=A6?= =?utf8?q?=E3=81=84=E3=82=8B=E3=81=A8=E3=83=9E=E3=82=AF=E3=83=AD=E8=A8=AD?= =?utf8?q?=E5=AE=9A=E7=94=BB=E9=9D=A2=E3=81=A7=E3=82=B9=E3=82=BF=E3=83=83?= =?utf8?q?=E3=82=AF=E3=81=8C=E7=A0=B4=E5=A3=8A=E3=81=95=E3=82=8C=E3=82=8B?= =?utf8?q?=E5=95=8F=E9=A1=8C=E3=81=AE=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 4) マクロの作成、8) キー配置の作成でも登録マクロのバッファをそのまま再利用するため、長いマクロが登録されているとスタックが壊れる。 4,8ではバッファに空文字列を設定してから編集を行うようにした。 --- src/cmd-io/cmd-macro.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/cmd-io/cmd-macro.cpp b/src/cmd-io/cmd-macro.cpp index 68043420d..d3bfd1a8f 100644 --- a/src/cmd-io/cmd-macro.cpp +++ b/src/cmd-io/cmd-macro.cpp @@ -227,7 +227,7 @@ void do_cmd_macros(player_type *creature_ptr) "Press Left/Right arrow keys to move cursor. Backspace/Delete to delete a char."), 22, 0); prt(_("マクロ行動: ", "Action: "), 20, 0); - ascii_to_text(tmp, macro__buf); + tmp[0] = '\0'; if (askfor(tmp, 80)) { text_to_ascii(macro__buf, tmp); macro_add(buf, macro__buf); @@ -273,7 +273,7 @@ void do_cmd_macros(player_type *creature_ptr) "Press Left/Right arrow keys to move cursor. Backspace/Delete to delete a char."), 22, 0); prt(_("行動: ", "Action: "), 20, 0); - ascii_to_text(tmp, macro__buf); + tmp[0] = '\0'; if (askfor(tmp, 80)) { text_to_ascii(macro__buf, tmp); string_free(keymap_act[mode][(byte)(buf[0])]); -- 2.11.0