trickery bulletproofing

Prevent the pardoning of trickery in wizard mode from attempting
to continue when there's no longer any current level.  Also prevent
the ZEROCOMP configuration from trying to read from file descriptor -1
in case there're any other places which still let that slip through.
And fix an oddity in the VMS port's error() routine which has gone
unnoticed for years.
This commit is contained in:
nethack.rankin
2002-08-22 03:05:18 +00:00
parent f13035aa48
commit b840adcb62
4 changed files with 12 additions and 2 deletions

View File

@@ -220,6 +220,8 @@ If there were a hole outside a shop, you could kick stuff out of the door
curing hallucination while wielding Grayswandir should print a message
removing unowned pick-axe from container in shop gave inappropriate message
don't let monster end up with more current HP than max HP after life drain
make sure that missing file trickery in wizard mode which is discovered during
level change doesn't try to keep going after discarding current level
Platform- and/or Interface-Specific Fixes
@@ -262,6 +264,7 @@ Gnome/Linux: more portable getres*id workaround
msdos: compiling without NO_TERMS resulted in a link-time error
msdos: reworked Makefile.GCC to get rid of need to duplicate source files
msdos,win32: stop doing chdir when NOCWD_ASSUMPTIONS is defined
vms: prevent error() from indirectly triggering hangup save during forced exit
General New Features

View File

@@ -1055,6 +1055,8 @@ boolean at_stairs, falling, portal;
(int) new_ledger, depth(&u.uz), errno);
pline("Probably someone removed it.");
done(TRICKED);
/* we'll reach here if running in wizard mode */
error("Cannot continue this game.");
}
minit(); /* ZEROCOMP */
getlev(fd, hackpid, new_ledger, FALSE);

View File

@@ -1,4 +1,4 @@
/* SCCS Id: @(#)restore.c 3.4 1999/11/20 */
/* SCCS Id: @(#)restore.c 3.4 2002/08/21 */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */
@@ -1026,6 +1026,7 @@ genericptr_t buf;
register unsigned len;
{
/*register int readlen = 0;*/
if (fd < 0) error("Restore error; mread attempting to read file %d.", fd);
mreadfd = fd;
while (len--) {
if (inrunlength > 0) {

View File

@@ -1,4 +1,4 @@
/* SCCS Id: @(#)vmstty.c 3.4 1995/07/09 */
/* SCCS Id: @(#)vmstty.c 3.4 2002/08/21 */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */
/* tty.c - (VMS) version */
@@ -477,5 +477,9 @@ error VA_DECL(const char *,s)
Vprintf(s,VA_ARGS);
(void) putchar('\n');
VA_END();
#ifndef SAVE_ON_FATAL_ERROR
/* prevent vmsmain's exit handler byebye() from calling hangup() */
(void)signal(SIGHUP, SIG_DFL);
#endif
exit(EXIT_FAILURE);
}