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

Comparing ray/src/cv/bsdfquery.c (file contents):
Revision 2.1 by greg, Thu Nov 21 23:57:28 2013 UTC vs.
Revision 2.3 by greg, Fri Apr 11 20:27:23 2014 UTC

# Line 27 | Line 27 | readIOdir(FVECT idir, FVECT odir, FILE *fp, int fmt)
27  
28          switch (fmt) {
29          case 'a':
30 <                if (fscanf(fp, "%lf %lf %lf %lf %lf %lf",
31 <                        dvec, dvec+1, dvec+2, dvec+3, dvec+4, dvec+5) != 6)
30 >                if (fscanf(fp, FVFORMAT, dvec, dvec+1, dvec+2) != 3 ||
31 >                                fscanf(fp, FVFORMAT, dvec+3, dvec+4, dvec+5) != 3)
32                          return(0);
33                  VCOPY(idir, dvec);
34                  VCOPY(odir, dvec+3);
# Line 74 | Line 74 | main(int argc, char *argv[])
74                          outfmt = argv[1][3];
75                  ++argv; --argc;
76          }
77 <        if ((n = strlen(argv[1])-4) > 0) {
77 >        if (argc > 1 && (n = strlen(argv[1])-4) > 0) {
78                  if (!strcasecmp(argv[1]+n, ".xml"))
79                          inpXML = 1;
80                  else if (!strcasecmp(argv[1]+n, ".sir"))
81                          inpXML = 0;
82          }
83 <        if (inpXML < 0) {
83 >        if ((argc != 2) | (inpXML < 0)) {
84                  fprintf(stderr, "Usage: %s [-fio] bsdf.{sir|xml}\n", progname);
85                  return(1);
86          }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines