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

Comparing ray/src/cv/pabopto2xyz.c (file contents):
Revision 2.3 by greg, Mon Aug 22 21:03:00 2016 UTC vs.
Revision 2.6 by greg, Thu Feb 11 03:05:34 2021 UTC

# Line 465 | Line 465 | advance_incidence(PGINPUT *slist[3], int ndx[3])
465   int
466   main(int argc, char *argv[])
467   {
468        char    *flist[MAX_INPUTS];
468          PGINPUT *slist[3];
469          int     i, j;
470          int     ndx[3];
# Line 491 | Line 490 | main(int argc, char *argv[])
490                  default:
491                          goto userr;
492                  }
493 <        if (i > argc-3)
493 >        if (i != argc-3)
494                  goto userr;
495          for (j = 0; j < 3; j++) {               /* prep input channels */
496 +                char    *flist[MAX_INPUTS];
497                  int     k, n;
498                  n = wordfile(flist, MAX_INPUTS, argv[i+j]);
499 <                if (n <= 0) {
499 >                if ((n <= 0) | (n >= MAX_INPUTS-1)) {
500                          fputs(argv[i+j], stderr);
501 <                        fputs(": cannot load input file names\n", stderr);
501 >                        if (n < 0)
502 >                                fputs(": cannot load input file names\n", stderr);
503 >                        else if (n == 0)
504 >                                fputs(": empty file\n", stderr);
505 >                        else /* n >= MAX_INPUTS-1 */
506 >                                fputs(": too many file names\n", stderr);
507                          return(1);
508                  }
509                  slist[j] = (PGINPUT *)malloc(sizeof(PGINPUT)*(n+1));

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines