Merge pull request #49 from nigels-com/merge-fread-fixup

Resolve release-mode gcc compilation warning: fread return value ignored
This commit is contained in:
Mikko Mononen 2015-12-21 14:01:54 +02:00
commit fcb2214e46

View File

@ -2815,7 +2815,7 @@ NSVGimage* nsvgParseFromFile(const char* filename, const char* units, float dpi)
fseek(fp, 0, SEEK_SET); fseek(fp, 0, SEEK_SET);
data = (char*)malloc(size+1); data = (char*)malloc(size+1);
if (data == NULL) goto error; if (data == NULL) goto error;
fread(data, size, 1, fp); if (fread(data, 1, size, fp) != size) goto error;
data[size] = '\0'; // Must be null terminated. data[size] = '\0'; // Must be null terminated.
fclose(fp); fclose(fp);
image = nsvgParse(data, units, dpi); image = nsvgParse(data, units, dpi);