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

Comparing ray/src/cal/rcalc.c (file contents):
Revision 1.7 by schorsch, Sun Jul 27 22:12:01 2003 UTC vs.
Revision 1.9 by greg, Wed Nov 5 19:03:03 2003 UTC

# Line 17 | Line 17 | static const char RCSid[] = "$Id$";
17   #include  "calcomp.h"
18   #include  "rterror.h"
19  
20 #ifdef  CPM
21 #define  getc           agetc   /* text files only, right? */
22 #endif
23
20   #define  isnum(c)       (isdigit(c) || (c)=='-' || (c)=='.' \
21                                  || (c)=='+' || (c)=='e' || (c)=='E')
22  
# Line 151 | Line 147 | char  *argv[]
147                                          nbicols = atoi(argv[i]+3);
148                                  else
149                                          nbicols = 1;
150 +                                if (nbicols*sizeof(double) > INBSIZ) {
151 +                                        eputs(argv[0]);
152 +                                        eputs(": too many input columns\n");
153 +                                        quit(1);
154 +                                }
155                                  break;
156                          case 'f':
157                                  if (isdigit(argv[i][3]))
158                                          nbicols = -atoi(argv[i]+3);
159                                  else
160                                          nbicols = -1;
161 +                                if (-nbicols*sizeof(float) > INBSIZ) {
162 +                                        eputs(argv[0]);
163 +                                        eputs(": too many input columns\n");
164 +                                        quit(1);
165 +                                }
166                                  break;
167                          default:
168                                  goto userr;
# Line 650 | Line 656 | register struct field  *f
656                          delim = f->next->f.sl[0];
657                  cp = buf;
658                  do {
659 <                        if (ipb.chr == EOF)
659 >                        if (ipb.chr == EOF || ipb.chr == '\n')
660                                  inword = 0;
661                          else if (blnkeq && delim != EOF)
662                                  inword = isblnk(delim) ?

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines