ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/rt/rv2.c
(Generate patch)

Comparing ray/src/rt/rv2.c (file contents):
Revision 1.26 by greg, Mon Aug 26 10:12:02 1991 UTC vs.
Revision 1.28 by greg, Thu Oct 10 12:08:58 1991 UTC

# Line 542 | Line 542 | char  *s;
542   writepict(s)                            /* write the picture to a file */
543   char  *s;
544   {
545 +        extern char  VersionID[];
546          static char  buf[128];
547          char  *fname;
548          FILE  *fp;
# Line 565 | Line 566 | char  *s;
566          fputs(progname, fp);
567          fprintview(&ourview, fp);
568          putc('\n', fp);
569 +        fprintf(fp, "SOFTWARE= %s\n", VersionID);
570          if (exposure != 1.0)
571                  fputexpos(exposure, fp);
572          if (dev->pixaspect != 1.0)
# Line 574 | Line 576 | char  *s;
576          fputresolu(YMAJOR|YDECR, hresolu, vresolu, fp);
577  
578          scanline = (COLR *)malloc(hresolu*sizeof(COLR));
579 <        if (scanline == NULL)
580 <                error(SYSTEM, "out of memory in writepict");
579 >        if (scanline == NULL) {
580 >                error(COMMAND, "not enough memory!");
581 >                fclose(fp);
582 >                unlink(fname);
583 >                return;
584 >        }
585          for (y = vresolu-1; y >= 0; y--) {
586                  getpictcolrs(y, scanline, &ptrunk, hresolu, vresolu);
587                  if (fwritecolrs(scanline, hresolu, fp) < 0)
588                          break;
589          }
590 +        free((char *)scanline);
591          if (fclose(fp) < 0)
592                  error(COMMAND, "write error");
586        free((char *)scanline);
593   }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines