- fread(&count, sizeof(count), 1, f);
- if (memcmp(magic, "FPS1", 4) != 0 || count <= 0) {
- fprintf(stderr, "Error: %s is not a Firm pattern store. Ignored.\n", fname);
- fclose(f);
- return NULL;
- } /* if */
+ res = fread(&count, sizeof(count), 1, f);
+ if (res != 1 || memcmp(magic, "FPS1", 4) != 0 || count <= 0)
+ goto read_error;