build and bug fixes for USE_OLDARGS
New: call to panic() in impossible() used arbitrary string as a
format so was vulnerable to percent signs in that string. (This
potentially serious problem is not limited to USE_OLDARGS.)
Old: revised message string for impossible ("save/restore might fix
this" instead of "perhaps you'd better quit") passed wrong number of
arguments to pline() when using the clumsy VA_PASSx() mechanism (was
missing arg 0 for the fixed-arg format argument).
Old: varargs config_error_add() in files.c wouldn't compile for
USE_OLDARGS. Evidently no one has been impacted by that but this
fixes it anyway. (Two problems: prototype used FDECL() when it
should have been using VDECL(), and calls to config_error_add() in
the same file would need the VA_PASSx() stuff to force presence of
all optional args. I moved it instead of adding the latter.)
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
/* NetHack 3.6 extern.h $NHDT-Date: 1541145514 2018/11/02 07:58:34 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.645 $ */
|
||||
/* NetHack 3.6 extern.h $NHDT-Date: 1541719965 2018/11/08 23:32:45 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.647 $ */
|
||||
/* Copyright (c) Steve Creps, 1988. */
|
||||
/* NetHack may be freely redistributed. See license for details. */
|
||||
|
||||
@@ -785,7 +785,7 @@ E void FDECL(unlock_file, (const char *));
|
||||
E boolean FDECL(can_read_file, (const char *));
|
||||
#endif
|
||||
E void FDECL(config_error_init, (BOOLEAN_P, const char *, BOOLEAN_P));
|
||||
E void FDECL(config_error_add, (const char *, ...)) PRINTF_F(1, 2);
|
||||
E void FDECL(config_erradd, (const char *));
|
||||
E int NDECL(config_error_done);
|
||||
E boolean FDECL(read_config_file, (const char *, int));
|
||||
E void FDECL(check_recordfile, (const char *));
|
||||
@@ -1877,6 +1877,7 @@ E void VDECL(There, (const char *, ...)) PRINTF_F(1, 2);
|
||||
E void VDECL(verbalize, (const char *, ...)) PRINTF_F(1, 2);
|
||||
E void VDECL(raw_printf, (const char *, ...)) PRINTF_F(1, 2);
|
||||
E void VDECL(impossible, (const char *, ...)) PRINTF_F(1, 2);
|
||||
E void VDECL(config_error_add, (const char *, ...)) PRINTF_F(1, 2);
|
||||
|
||||
/* ### polyself.c ### */
|
||||
|
||||
|
||||
Reference in New Issue
Block a user