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

Comparing ray/src/ot/wfconv.c (file contents):
Revision 2.8 by schorsch, Sat Mar 27 12:41:45 2004 UTC vs.
Revision 2.10 by greg, Fri Nov 8 16:49:04 2013 UTC

# Line 15 | Line 15 | typedef int    VNDX[3];        /* vertex index (point,map,normal
15  
16   #define CHUNKSIZ        1024    /* vertex allocation chunk size */
17  
18 < #define MAXARG          64      /* maximum # arguments in a statement */
18 > #define MAXARG          512     /* maximum # arguments in a statement */
19  
20   static FVECT    *vlist;         /* our vertex list */
21   static int      nvs;            /* number of vertices in our list */
# Line 26 | Line 26 | static int     nvts;
26  
27   static char     *inpfile;       /* input file name */
28   static int      havemats;       /* materials available? */
29 < static char     material[64];   /* current material name */
30 < static char     group[64];      /* current group name */
29 > static char     material[256];  /* current material name */
30 > static char     group[256];     /* current group name */
31   static int      lineno;         /* current line number */
32   static int      faceno;         /* current face number */
33  
# Line 158 | Line 158 | wfreadobj(             /* read in .OBJ file and convert */
158  
159   static int
160   getstmt(                                /* read the next statement from fp */
161 <        register char   *av[MAXARG],
161 >        char    *av[MAXARG],
162          FILE    *fp
163   )
164   {
165          static char     sbuf[MAXARG*16];
166 <        register char   *cp;
167 <        register int    i;
166 >        char    *cp;
167 >        int     i;
168  
169          do {
170                  if (fgetline(cp=sbuf, sizeof(sbuf), fp) == NULL)
# Line 176 | Line 176 | getstmt(                               /* read the next statement from fp */
176                                          lineno++;
177                                  *cp++ = '\0';
178                          }
179 <                        if (!*cp || i >= MAXARG-1)
179 >                        if (!*cp)
180                                  break;
181 +                        if (i >= MAXARG-1) {
182 +                                sprintf(errmsg,
183 +                        "%s: too many arguments near line %d (limit %d)\n",
184 +                                        inpfile, lineno+1, MAXARG-1);
185 +                                break;
186 +                        }
187                          av[i++] = cp;
188                          while (*++cp && !isspace(*cp))
189                                  ;
# Line 192 | Line 198 | getstmt(                               /* read the next statement from fp */
198  
199   static int
200   cvtndx(                         /* convert vertex string to index */
201 <        register VNDX   vi,
202 <        register char   *vs
201 >        VNDX    vi,
202 >        char    *vs
203   )
204   {
205                                          /* get point */
# Line 242 | Line 248 | cvtndx(                                /* convert vertex string to index */
248   static int
249   putface(                                /* put out an N-sided polygon */
250          int     ac,
251 <        register char   **av
251 >        char    **av
252   )
253   {
254          char            *cp;
255 <        register int    i;
255 >        int     i;
256  
257          while (ac > 3) {                /* break into triangles */
258                  if (!puttri(av[0], av[1], av[2]))

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines