47 |
|
sprintf(errmsg, "cannot open picture '%s'", fname); |
48 |
|
error(SYSTEM, errmsg); |
49 |
|
} |
50 |
+ |
#ifdef getc_unlocked |
51 |
+ |
flockfile(fp); |
52 |
+ |
#endif |
53 |
|
dt = DTfromHeader; |
54 |
|
if ((err = cm_getheader(&dt, NULL, NULL, NULL, NULL, fp)) != NULL) |
55 |
|
error(USER, err); |
77 |
|
} |
78 |
|
/* flat file check */ |
79 |
|
if ((data_start = ftell(fp)) > 0 && fseek(fp, 0L, SEEK_END) == 0) { |
80 |
< |
flat_file = (ftell(fp) == data_start + sizeof(COLR)*xr*yr); |
80 |
> |
flat_file = (ftell(fp) >= data_start + sizeof(COLR)*xr*yr); |
81 |
|
if (fseek(fp, data_start, SEEK_SET) < 0) { |
82 |
|
sprintf(errmsg, "cannot seek on picture '%s'", fname); |
83 |
|
error(SYSTEM, errmsg); |