do { \
FILE *fp = fopen(FILE_PATH, "r"); \
if (fp) { \
- fseek(fp, 0, SEEK_END); \
+ if (fseek(fp, 0, SEEK_END) < 0) { printf("fseek failed\n"); fclose(fp); break; } \
size = ftell(fp); \
- fseek(fp, 0, SEEK_SET); \
+ if (fseek(fp, 0, SEEK_SET) < 0) { printf("fseek failed\n"); fclose(fp); break; } \
if (size > 0) data = malloc(size); \
if (data != NULL) { if (fread(data, size, sizeof(char), fp) != size) { printf("fread error\n"); } } \
fclose(fp); \