diff --git a/doc/evilhack-changelog.md b/doc/evilhack-changelog.md index cf75f0640..cb9038eb5 100644 --- a/doc/evilhack-changelog.md +++ b/doc/evilhack-changelog.md @@ -3343,4 +3343,5 @@ The following changes to date are: - Fix: crash when examining discoveries with '`' in certain cases - Fix: allow spear traps to be disarmed - Fix: heap-use-after-free (bones) +- Fix: follow up to crash when examining discoveries with '`' in certain cases diff --git a/src/invent.c b/src/invent.c index c22ed0cb8..ec035fc09 100644 --- a/src/invent.c +++ b/src/invent.c @@ -4102,7 +4102,7 @@ boolean unpaid, showsym; else if ((pos = index(oth_symbols, let)) != 0) class_name = oth_names[pos - oth_symbols]; else - class_name = names[0]; + class_name = names[ILLOBJ_CLASS]; len = strlen(class_name) + (unpaid ? sizeof "unpaid_" : sizeof "") + (oclass ? (strlen(ocsymfmt) + invbuf_sympadding) : 0); diff --git a/win/curses/cursdial.c b/win/curses/cursdial.c index 79828f42b..7db85d353 100644 --- a/win/curses/cursdial.c +++ b/win/curses/cursdial.c @@ -318,7 +318,8 @@ curses_character_input_dialog(const char *prompt, const char *choices, } break; } else if ((answer == '\n') || (answer == '\r') || (answer == ' ')) { - if (choices != NULL) { + if ((choices != NULL) + && ((def != '\0') || !strchr(choices, answer))) { answer = def; } break;