]> granicus.if.org Git - nethack/commitdiff
'v' vs '%'
authorPatR <rankin@nethack.org>
Wed, 14 Oct 2015 23:58:26 +0000 (16:58 -0700)
committerPatR <rankin@nethack.org>
Wed, 14 Oct 2015 23:58:26 +0000 (16:58 -0700)
Guard against the possibility of BETA_INFO (or other fields used to
construct the one-line version string) having a percent sign that would
be misinterpreted during pline processing.

src/version.c

index 7fe4506f613e3d4f81e694bf4b5ce83e183fa8ec..99fb2c3832be4bb338fde2c79dc339a7abcb8059 100644 (file)
@@ -1,4 +1,4 @@
-/* NetHack 3.6 version.c       $NHDT-Date: 1434999940 2015/06/22 19:05:40 $  $NHDT-Branch: master $:$NHDT-Revision: 1.38 $ */
+/* NetHack 3.6 version.c       $NHDT-Date: 1444867101 2015/10/14 23:58:21 $  $NHDT-Branch: master $:$NHDT-Revision: 1.39 $ */
 /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
 /* NetHack may be freely redistributed.  See license for details. */
 
@@ -48,7 +48,7 @@ doversion()
 {
     char buf[BUFSZ];
 
-    pline1(getversionstring(buf));
+    pline("%s", getversionstring(buf));
     return 0;
 }
 
@@ -225,13 +225,12 @@ boolean complain;
         return FALSE;
     } else if (
 #ifndef IGNORED_FEATURES
-        version_data->feature_set != VERSION_FEATURES ||
+        version_data->feature_set != VERSION_FEATURES
 #else
         (version_data->feature_set & ~IGNORED_FEATURES)
             != (VERSION_FEATURES & ~IGNORED_FEATURES)
-        ||
 #endif
-        version_data->entity_count != VERSION_SANITY1
+        || version_data->entity_count != VERSION_SANITY1
         || version_data->struct_sizes1 != VERSION_SANITY2
         || version_data->struct_sizes2 != VERSION_SANITY3) {
         if (complain)