more warnings

This commit is contained in:
Rudolf Polzer 2010-10-05 15:06:52 +02:00
parent d5a9782200
commit cadab3422e

View File

@ -302,7 +302,7 @@ int vfsLoadFile (const char *filename, void **bufferptr, int index)
return -1; return -1;
} }
if(fread (*bufferptr, 1, len, f) != len) if(fread (*bufferptr, 1, len, f) != (size_t) len)
{ {
fclose(f); fclose(f);
return -1; return -1;
@ -341,9 +341,16 @@ int vfsLoadFile (const char *filename, void **bufferptr, int index)
*bufferptr = safe_malloc (len+1); *bufferptr = safe_malloc (len+1);
if (*bufferptr == NULL) if (*bufferptr == NULL)
{
fclose(f);
return -1; return -1;
}
fread (*bufferptr, 1, len, f); if(fread (*bufferptr, 1, len, f) != (size_t) len)
{
fclose(f);
return -1;
}
fclose (f); fclose (f);
// we need to end the buffer with a 0 // we need to end the buffer with a 0