From 34ec1ec3f537e11d9bd27c385cbdc332f33dfc69 Mon Sep 17 00:00:00 2001 From: Ozkan Sezer Date: Fri, 18 Aug 2023 23:33:10 +0300 Subject: [PATCH] fix another -Wunused-result warning. --- Quake/gl_texmgr.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Quake/gl_texmgr.c b/Quake/gl_texmgr.c index fead0d5ca..12770dd07 100644 --- a/Quake/gl_texmgr.c +++ b/Quake/gl_texmgr.c @@ -1290,6 +1290,7 @@ void TexMgr_ReloadImage (gltexture_t *glt, int shirt, int pants) if (glt->source_file[0] && glt->source_offset) { //lump inside file FILE *f; + int sz; COM_FOpenFile(glt->source_file, &f, NULL); if (!f) goto invalid; fseek (f, glt->source_offset, SEEK_CUR); @@ -1302,8 +1303,12 @@ void TexMgr_ReloadImage (gltexture_t *glt, int shirt, int pants) size *= lightmap_bytes; } data = (byte *) Hunk_Alloc (size); - fread (data, 1, size, f); + sz = (int) fread (data, 1, size, f); fclose (f); + if (sz != size) { + Hunk_FreeToLowMark(mark); + Host_Error("Read error for %s", glt->name); + } } else if (glt->source_file[0] && !glt->source_offset) { data = Image_LoadImage (glt->source_file, (int *)&glt->source_width, (int *)&glt->source_height); //simple file