From: nethack.allison Date: Mon, 27 Oct 2003 00:23:22 +0000 (+0000) Subject: saving msg history glitch (trunk only) X-Git-Tag: MOVE2GIT~1629 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=dbb1d0f230aeb9777a8f782cb2eb25eec60ae9e5;p=nethack saving msg history glitch (trunk only) discovered that it is possible to have wins[WIN_MESSAGE] be null during a hangup, not sure why yet. Put a guard in to prevent de-referencing a null pointer. --- diff --git a/win/tty/topl.c b/win/tty/topl.c index a37043c52..c1f4f06c4 100644 --- a/win/tty/topl.c +++ b/win/tty/topl.c @@ -469,6 +469,7 @@ boolean init; register struct WinDesc *cw = wins[WIN_MESSAGE]; char *retstr = (char *)0; + if (!cw) return (char *)0; /* bail */ /* * state 0 = normal return with string from msg history. * state 1 = finished with recall data, return toplines.