From: Rudolf Polzer Date: Tue, 5 Oct 2010 13:06:52 +0000 (+0200) Subject: more warnings X-Git-Tag: xonotic-v0.5.0~196 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=cadab3422ef3ad1d9561dd1e1ec1f56ec8a885d6;p=xonotic%2Fnetradiant.git more warnings --- diff --git a/tools/quake3/common/vfs.c b/tools/quake3/common/vfs.c index 3d731333..86a749c7 100644 --- a/tools/quake3/common/vfs.c +++ b/tools/quake3/common/vfs.c @@ -302,7 +302,7 @@ int vfsLoadFile (const char *filename, void **bufferptr, int index) return -1; } - if(fread (*bufferptr, 1, len, f) != len) + if(fread (*bufferptr, 1, len, f) != (size_t) len) { fclose(f); return -1; @@ -341,9 +341,16 @@ int vfsLoadFile (const char *filename, void **bufferptr, int index) *bufferptr = safe_malloc (len+1); if (*bufferptr == NULL) + { + fclose(f); return -1; + } - fread (*bufferptr, 1, len, f); + if(fread (*bufferptr, 1, len, f) != (size_t) len) + { + fclose(f); + return -1; + } fclose (f); // we need to end the buffer with a 0