| 233 |
|
dolock(outfd, F_WRLCK); |
| 234 |
|
if ((fp = fdopen(dup(outfd), "w")) == NULL) |
| 235 |
|
goto filerr; |
| 236 |
< |
printargs(ac, av, fp); /* write header */ |
| 236 |
> |
newheader("RADIANCE", fp); /* create header */ |
| 237 |
> |
printargs(ac, av, fp); |
| 238 |
|
fprintf(fp, "SOFTWARE= %s\n", VersionID); |
| 239 |
|
fputs(VIEWSTR, fp); |
| 240 |
|
fprintview(&ourview, fp); |
| 345 |
|
return(0); /* only check if asked */ |
| 346 |
|
if (pdone == NULL) /* first call */ |
| 347 |
|
pdone = calloc(hmult*vmult, sizeof(char)); |
| 348 |
+ |
if (pdone == NULL) { |
| 349 |
+ |
fprintf(stderr, "%s: out of memory\n", progname); |
| 350 |
+ |
exit(1); |
| 351 |
+ |
} |
| 352 |
|
if (readpos != -1) /* mark what's been done */ |
| 353 |
|
fseek(syncfp, readpos, 0); |
| 354 |
|
while (fscanf(syncfp, "%d %d", xp, yp) == 2) |