saving msg history glitch (trunk only)

<Someone> 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.
This commit is contained in:
nethack.allison
2003-10-27 00:23:22 +00:00
parent 211666434c
commit dbb1d0f230

View File

@@ -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.