foxygit / doom Log in
commit fff2e0e0587eac81c8ba4c48dcb1141a08b3f450
Author:     Fabian Greffrath <fabian@greffrath.com>
AuthorDate: Wed Jan 23 21:21:39 2019 +0100
Commit:     Fabian Greffrath <fabian@greffrath.com>
CommitDate: Wed Jan 23 21:21:39 2019 +0100

    pass buffer size to M_snprintf() instead of string length
---
 src/doom/m_menu.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/doom/m_menu.c b/src/doom/m_menu.c
index 647d539d..8587e027 100644
--- a/src/doom/m_menu.c
+++ b/src/doom/m_menu.c
@@ -638,12 +638,12 @@ static void SetDefaultSaveName(int slot)
     // 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);
     }