shithub: choc

Download patch

ref: fff2e0e0587eac81c8ba4c48dcb1141a08b3f450
parent: 82109a9cc01a259f0625e468dc269ddbdd0c7f25
author: Fabian Greffrath <fabian@greffrath.com>
date: Wed Jan 23 16:21:39 EST 2019

pass buffer size to M_snprintf() instead of string length

--- a/src/doom/m_menu.c
+++ b/src/doom/m_menu.c
@@ -638,12 +638,12 @@
     // map from IWAD or PWAD?
     if (maplumpinfo->wad_file == lumpinfo[0]->wad_file)
     {
-        M_snprintf(savegamestrings[itemOn], SAVESTRINGSIZE - 1,
+        M_snprintf(savegamestrings[itemOn], SAVESTRINGSIZE,
                    "%s", maplumpinfo->name);
     }
     else
     {
-        M_snprintf(savegamestrings[itemOn], SAVESTRINGSIZE - 1,
+        M_snprintf(savegamestrings[itemOn], SAVESTRINGSIZE,
                    "%s: %s", M_BaseName(maplumpinfo->wad_file->path),
                    maplumpinfo->name);
     }