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

Comparing ray/src/util/rfluxmtx.c (file contents):
Revision 2.36 by schorsch, Sun Mar 6 01:13:18 2016 UTC vs.
Revision 2.37 by greg, Fri Apr 15 00:06:36 2016 UTC

# Line 643 | Line 643 | sample_origin(PARAMS *p, FVECT orig, const FVECT rdir,
643          if (p->nsurfs > nall) {         /* (re)allocate surface area cache */
644                  if (projsa) free(projsa);
645                  projsa = (double *)malloc(sizeof(double)*p->nsurfs);
646 <                if (!projsa) return(0);
646 >                if (projsa == NULL) {
647 >                        fputs(progname, stderr);
648 >                        fputs(": out of memory in sample_origin!\n", stderr);
649 >                        exit(1);
650 >                }
651                  nall = p->nsurfs;
652          }
653                                          /* compute projected areas */
# Line 942 | Line 946 | add_surface(int st, const char *oname, FILE *fp)
946          snew = (SURF *)malloc(sizeof(SURF) + sizeof(double)*(n-1));
947          if (snew == NULL) {
948                  fputs(progname, stderr);
949 <                fputs(": out of memory!\n", stderr);
949 >                fputs(": out of memory in add_surface!\n", stderr);
950                  exit(1);
951          }
952          strncpy(snew->sname, oname, sizeof(snew->sname)-1);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines