Skip to content

Commit

Permalink
fix another -Wunused-result warning.
Browse files Browse the repository at this point in the history
(cherry picked from commit 34ec1ec)
  • Loading branch information
sezero authored and alexey-lysiuk committed Aug 19, 2023
1 parent ce46733 commit 743495a
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion Quake/gl_texmgr.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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
Expand Down

0 comments on commit 743495a

Please sign in to comment.