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

Comparing ray/src/rt/rcontrib.c (file contents):
Revision 2.26 by greg, Wed Jul 15 23:38:37 2015 UTC vs.
Revision 2.27 by greg, Mon Mar 21 19:06:08 2016 UTC

# Line 101 | Line 101 | addmodifier(char *modn, char *outf, char *prms, char *
101                  sprintf(errmsg, "duplicate modifier '%s'", modn);
102                  error(USER, errmsg);
103          }
104 <        if (nmods >= MAXMODLIST)
105 <                error(INTERNAL, "too many modifiers");
104 >        if (nmods >= MAXMODLIST) {
105 >                sprintf(errmsg, "too many modifiers (%d limit)", MAXMODLIST);
106 >                error(INTERNAL, errmsg);
107 >        }
108          if (!strcmp(modn, VOIDID)) {
109                  sprintf(errmsg, "cannot track '%s' modifier", VOIDID);
110                  error(USER, errmsg);
# Line 150 | Line 152 | addmodfile(char *fname, char *outf, char *prms, char *
152          char    *mname[MAXMODLIST];
153          int     i;
154                                          /* find the file & store strings */
155 <        if (wordfile(mname, getpath(fname, getrlibpath(), R_OK)) < 0) {
155 >        i = wordfile(mname, MAXMODLIST, getpath(fname, getrlibpath(), R_OK));
156 >        if (i < 0) {
157                  sprintf(errmsg, "cannot find modifier file '%s'", fname);
158                  error(SYSTEM, errmsg);
159 +        }
160 +        if (i >= MAXMODLIST-1) {
161 +                sprintf(errmsg, "too many modifiers (%d limit) in file '%s'",
162 +                                MAXMODLIST-1, fname);
163 +                error(INTERNAL, errmsg);
164          }
165          for (i = 0; mname[i]; i++)      /* add each one */
166                  addmodifier(mname[i], outf, prms, binv, bincnt);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines