diff --git a/doc/fixes35.0 b/doc/fixes35.0 index cdd75913c..1b15c59fe 100644 --- a/doc/fixes35.0 +++ b/doc/fixes35.0 @@ -847,6 +847,7 @@ when a monster zapped by polymorph drops inventory because of its new form, entering an untended shop while blind gave an inappropriate message engraving feedback about partial text when weapon became too dull to finish was lacking sentence-ending period +impossible() might display inaccurate feedback after updating paniclog Platform- and/or Interface-Specific Fixes diff --git a/src/pline.c b/src/pline.c index 53029c8dc..d4cdb9c43 100644 --- a/src/pline.c +++ b/src/pline.c @@ -302,17 +302,17 @@ raw_printf VA_DECL(const char *, line) /*VARARGS1*/ void impossible VA_DECL(const char *, s) + char pbuf[2*BUFSZ]; VA_START(s); VA_INIT(s, const char *); if (program_state.in_impossible) - panic("impossible called impossible"); + panic("impossible called impossible"); + program_state.in_impossible = 1; - { - char pbuf[BUFSZ]; - Vsprintf(pbuf,s,VA_ARGS); - paniclog("impossible", pbuf); - } - vpline(s,VA_ARGS); + Vsprintf(pbuf, s, VA_ARGS); + pbuf[BUFSZ-1] = '\0'; /* sanity */ + paniclog("impossible", pbuf); + pline("%s", pbuf); pline("Program in disorder - perhaps you'd better #quit."); program_state.in_impossible = 0; VA_END();