foxygit / doom Log in
commit 091fdce05986d001d3bea0c5406572b8d933b409
Author:     Turo Lamminen <turotl@gmail.com>
AuthorDate: Sat Jan 6 15:20:48 2018 +0200
Commit:     Turo Lamminen <turotl@gmail.com>
CommitDate: Sat Jan 27 16:46:04 2018 +0200

    heretic: Don't ignore return value of fread() call
---
 src/heretic/mn_menu.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/heretic/mn_menu.c b/src/heretic/mn_menu.c
index d2a7d605..733c3181 100644
--- a/src/heretic/mn_menu.c
+++ b/src/heretic/mn_menu.c
@@ -642,6 +642,7 @@ void MN_LoadSlotText(void)

     for (i = 0; i < 6; i++)
     {
+        int retval;
         filename = SV_Filename(i);
         fp = fopen(filename, "rb+");
 	free(filename);
@@ -652,9 +653,9 @@ void MN_LoadSlotText(void)
             SlotStatus[i] = 0;
             continue;
         }
-        fread(&SlotText[i], 1, SLOTTEXTLEN, fp);
+        retval = fread(&SlotText[i], 1, SLOTTEXTLEN, fp);
         fclose(fp);
-        SlotStatus[i] = 1;
+        SlotStatus[i] = retval == SLOTTEXTLEN;
     }
     slottextloaded = true;
 }