]> granicus.if.org Git - nethack/commitdiff
another fix fox "killed, while helpless"
authorPatR <rankin@nethack.org>
Fri, 24 Aug 2018 01:01:00 +0000 (18:01 -0700)
committerPatR <rankin@nethack.org>
Fri, 24 Aug 2018 01:01:00 +0000 (18:01 -0700)
Augmented death reason with appended "while <helpless-reason>" was
broken in 3.6.0 and got fixed shortly after release (too late to
prevent high-score files from being corrupted).  Then within a
couple of weeks it got broken again, and doesn't work in 3.6.1
either (but in this case, it is omitted instead of being cloned
to all following score entries).  The problem is in both record
and logfile, but not xlogfile, so we could create a fix up routine
that would use the last to repair record (and perhaps logfile).
But having two fixup routines would probably lead to confusion.

The problem this time was bad logic in the fix for
|alter name of monster causing hero's death if name contains
|    characters that could cause confusion when using record,
|    logfile, or xlogfile later
killerformat() was going out of bounds of the input string and
using up all of 'siz' so that there was never room to append the
", while helpless" suffix.

doc/fixes36.2
src/topten.c

index 3d412d2cabc11ec0186ee4fdfb2aa47535700685..582b85c52cfcfb4bfc216aaf7f72c5705efbba16 100644 (file)
@@ -93,6 +93,8 @@ shop door repair which took place when hero was on another level only worked
        correctly if a trap at the same spot was removed
 object scattering during shop wall repair was skipped if a trap at the same
        spot was also being removed
+augmented death reason for "while helpless" was broken for record and logfile
+       (but still correct for xlogfile)
 
 
 Fixes to Post-3.6.1 Problems that Were Exposed Via git Repository
index fbe6573cb762398bdc9e3b6851b6377a62b70831..4652d42b247a4f315f1ccd06b8bd51f76eb6a9eb 100644 (file)
@@ -130,7 +130,9 @@ boolean incl_helpless;
      */
     while (--siz > 0) {
         c = *kname++;
-        if (c == ',')
+        if (!c)
+            break;
+        else if (c == ',')
             c = ';';
         /* 'xlogfile' doesn't really need protection for '=', but
            fixrecord.awk for corrupted 3.6.0 'record' does (only