]> granicus.if.org Git - nethack/commitdiff
fix wizard mode crash (SPLEVTYPE)
authornethack.rankin <nethack.rankin>
Wed, 13 Mar 2002 11:22:03 +0000 (11:22 +0000)
committernethack.rankin <nethack.rankin>
Wed, 13 Mar 2002 11:22:03 +0000 (11:22 +0000)
     Set SPLEVLTYPE to "soko1-1"; visit soko4-* (or minetown)
on the way there; oops:  access violation from deferencing a
null pointer.

src/mkmaze.c

index 9448b584e97b38d330819fe009a2798af6babda1..ca6dce51fdfcce329f9929d0e179a6ece3b13a47 100644 (file)
@@ -1,4 +1,4 @@
-/*     SCCS Id: @(#)mkmaze.c   3.4     2001/09/06      */
+/*     SCCS Id: @(#)mkmaze.c   3.4     2002/03/12      */
 /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
 /* NetHack may be freely redistributed.  See license for details. */
 
@@ -523,7 +523,7 @@ register const char *s;
                /* rindex always succeeds due to code in prior block */
                int len = (rindex(protofile, '-') - protofile) + 1;
 
-               while (*ep) {
+               while (ep && *ep) {
                    if (!strncmp(ep, protofile, len)) {
                        int pick = atoi(ep + len);
                        /* use choice only if valid */
@@ -544,7 +544,7 @@ register const char *s;
            if(load_special(protofile)) {
                fixup_special();
                /* some levels can end up with monsters
-                   on dead mon list, including light source monsters */
+                  on dead mon list, including light source monsters */
                dmonsfree();
                return; /* no mazification right now */
            }