| @@ -873,7 +873,7 @@ error: | |||||
| int fonsAddFont(FONScontext* stash, const char* name, const char* path) | int fonsAddFont(FONScontext* stash, const char* name, const char* path) | ||||
| { | { | ||||
| FILE* fp = 0; | FILE* fp = 0; | ||||
| int dataSize = 0; | |||||
| int dataSize = 0, readed; | |||||
| unsigned char* data = NULL; | unsigned char* data = NULL; | ||||
| // Read in the font data. | // Read in the font data. | ||||
| @@ -884,9 +884,10 @@ int fonsAddFont(FONScontext* stash, const char* name, const char* path) | |||||
| fseek(fp,0,SEEK_SET); | fseek(fp,0,SEEK_SET); | ||||
| data = (unsigned char*)malloc(dataSize); | data = (unsigned char*)malloc(dataSize); | ||||
| if (data == NULL) goto error; | if (data == NULL) goto error; | ||||
| fread(data, 1, dataSize, fp); | |||||
| readed = fread(data, 1, dataSize, fp); | |||||
| fclose(fp); | fclose(fp); | ||||
| fp = 0; | fp = 0; | ||||
| if (readed != dataSize) goto error; | |||||
| return fonsAddFontMem(stash, name, data, dataSize, 1); | return fonsAddFontMem(stash, name, data, dataSize, 1); | ||||