--- hatari/src/uae-cpu/gencpu.c 2019/04/01 07:14:55 1.1.1.9 +++ hatari/src/uae-cpu/gencpu.c 2019/04/09 08:47:23 1.1.1.11 @@ -61,8 +61,7 @@ /* on ST (fix Blood Money on Superior 65) */ - -const char GenCpu_rcsid[] = "Hatari $Id: gencpu.c,v 1.1.1.9 2019/04/01 07:14:55 root Exp $"; +const char GenCpu_fileid[] = "Hatari gencpu.c : " __DATE__ " " __TIME__; #include #include @@ -103,7 +102,9 @@ static void read_counts (void) file = fopen ("frequent.68k", "r"); if (file) { - fscanf (file, "Total: %lu\n", &total); + if (fscanf (file, "Total: %lu\n", &total) == EOF) { + perror("read_counts"); + } while (fscanf (file, "%lx: %lu %s\n", &opcode, &count, name) == 3) { opcode_next_clev[nr] = 4; opcode_last_postfix[nr] = -1; @@ -2694,7 +2695,10 @@ int main (int argc, char **argv) headerfile = fopen ("cputbl.h", "wb"); stblfile = fopen ("cpustbl.c", "wb"); - freopen ("cpuemu.c", "wb", stdout); + if (freopen ("cpuemu.c", "wb", stdout) == NULL) { + perror("cpuemu.c"); + return -1; + } generate_includes (stdout); generate_includes (stblfile);