avoid checkfile() segfault

Recent change for "pair of lenses names The Eyes of the Overworld"
triggered a segfault if item was neither named nor called.
This commit is contained in:
PatR
2018-12-23 12:03:53 -08:00
parent 0eb11aa718
commit 95acf0d93a
2 changed files with 5 additions and 4 deletions

View File

@@ -336,6 +336,7 @@ a config file line with OPTIONS=symset:default, roguesymset:RogueEpyx
meant to have color; that was due to an errant init_symbols() call meant to have color; that was due to an errant init_symbols() call
during the processing of symset:default done after RogueEpyx had during the processing of symset:default done after RogueEpyx had
already been processed already been processed
avoid potential segfault when doing 'more information' lookup
tty: turn off an optimization that is the suspected cause of Windows reported tty: turn off an optimization that is the suspected cause of Windows reported
partial status lines following level changes partial status lines following level changes
tty: ensure that current status fields are always copied to prior status tty: ensure that current status fields are always copied to prior status

View File

@@ -1,4 +1,4 @@
/* NetHack 3.6 pager.c $NHDT-Date: 1545361111 2018/12/21 02:58:31 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.143 $ */ /* NetHack 3.6 pager.c $NHDT-Date: 1545595360 2018/12/23 20:02:40 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.144 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/*-Copyright (c) Robert Patrick Rankin, 2018. */ /*-Copyright (c) Robert Patrick Rankin, 2018. */
/* NetHack may be freely redistributed. See license for details. */ /* NetHack may be freely redistributed. See license for details. */
@@ -646,9 +646,9 @@ char *supplemental_name;
The Eyes of the Overworld" simplified above to "lenses named The Eyes of the Overworld" simplified above to "lenses named
The Eyes of the Overworld", now reduced to "The Eyes of the The Eyes of the Overworld", now reduced to "The Eyes of the
Overworld", skip "The" as with base name processing) */ Overworld", skip "The" as with base name processing) */
if (!strncmpi(alt, "a ", 2) if (alt && (!strncmpi(alt, "a ", 2)
|| !strncmpi(alt, "an ", 3) || !strncmpi(alt, "an ", 3)
|| !strncmpi(alt, "the ", 4)) || !strncmpi(alt, "the ", 4)))
alt = index(alt, ' ') + 1; alt = index(alt, ' ') + 1;
/* remove charges or "(lit)" or wizmode "(N aum)" */ /* remove charges or "(lit)" or wizmode "(N aum)" */
if ((ep = strstri(dbase_str, " (")) != 0 && ep > dbase_str) if ((ep = strstri(dbase_str, " (")) != 0 && ep > dbase_str)