shithub: choc

Download patch

ref: f39a5d2cd1f33d5319f8870d03beb71d281ebfb6
parent: 091fdce05986d001d3bea0c5406572b8d933b409
author: Turo Lamminen <[email protected]>
date: Sat Jan 6 10:32:36 EST 2018

strife: Don't ignore return value of fread() call

--- a/src/strife/m_menu.c
+++ b/src/strife/m_menu.c
@@ -547,6 +547,7 @@
 
     for(i = 0; i < load_end; i++)
     {
+        int retval;
         if(fname)
             Z_Free(fname);
         fname = M_SafeFilePath(savegamedir, M_MakeStrifeSaveDir(i, "\\name"));
@@ -559,9 +560,9 @@
             LoadMenu[i].status = 0;
             continue;
         }
-        fread(savegamestrings[i], 1, SAVESTRINGSIZE, handle);
+        retval = fread(savegamestrings[i], 1, SAVESTRINGSIZE, handle);
         fclose(handle);
-        LoadMenu[i].status = 1;
+        LoadMenu[i].status = retval == SAVESTRINGSIZE;
     }
 
     if(fname)