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

Comparing ray/src/cv/obj2rad.c (file contents):
Revision 2.22 by schorsch, Sat Nov 15 17:54:06 2003 UTC vs.
Revision 2.23 by greg, Fri Apr 23 16:20:56 2004 UTC

# Line 37 | Line 37 | int    nvts;
37  
38   typedef int     VNDX[3];        /* vertex index (point,map,normal) */
39  
40 < #define CHUNKSIZ        256     /* vertex allocation chunk size */
40 > #define CHUNKSIZ        1024    /* vertex allocation chunk size */
41  
42 < #define MAXARG          64      /* maximum # arguments in a statement */
42 > #define MAXARG          512     /* maximum # arguments in a statement */
43  
44                                  /* qualifiers */
45   #define Q_MTL           0
# Line 310 | Line 310 | getstmt(                               /* read the next statement from fp */
310          FILE    *fp
311   )
312   {
313 <        extern char     *fgetline();
314 <        static char     sbuf[MAXARG*10];
313 >        static char     sbuf[MAXARG*16];
314          register char   *cp;
315          register int    i;
316  
# Line 325 | Line 324 | getstmt(                               /* read the next statement from fp */
324                                          lineno++;
325                                  *cp++ = '\0';
326                          }
327 <                        if (!*cp || i >= MAXARG-1)
327 >                        if (!*cp)
328                                  break;
329 +                        if (i >= MAXARG-1) {
330 +                                fprintf(stderr,
331 +                        "warning: line %d: too many arguments (limit %d)\n",
332 +                                        lineno+1, MAXARG-1);
333 +                                break;
334 +                        }
335                          av[i++] = cp;
336                          while (*++cp && !isspace(*cp))
337                                  ;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines