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

Comparing ray/src/util/rcollate.c (file contents):
Revision 2.10 by greg, Fri May 30 16:50:43 2014 UTC vs.
Revision 2.11 by greg, Fri May 30 17:29:28 2014 UTC

# Line 276 | Line 276 | int            no_columns = 0;                 /* number of output columns */
276   int             no_rows = 0;                    /* number of output rows */
277  
278   /* check settings and assign defaults */
279 < static void
279 > static int
280   check_sizes()
281   {
282          if (fmtid == NULL) {
# Line 288 | Line 288 | check_sizes()
288                          comp_size = sizeof(double);
289                  else if (!strcmp(fmtid, "byte"))
290                          comp_size = 1;
291 +                else {
292 +                        fprintf(stderr, "Unsupported format: %s\n", fmtid);
293 +                        return(0);
294 +                }
295          }
296          if (n_comp <= 0)
297                  n_comp = 3;
298 +        return(1);
299   }
300  
301   /* output transposed ASCII or binary data from memory */
# Line 573 | Line 578 | main(int argc, char *argv[])
578          if (i_header) {                         /* read header */
579                  if (getheader(stdin, &headline, NULL) < 0)
580                          return(1);
581 <                check_sizes();
581 >                if (!check_sizes())
582 >                        return(1);
583                  if (comp_size) {                /* a little late... */
584                          SET_FILE_BINARY(stdin);
585                          SET_FILE_BINARY(stdout);
586                  }
587 <        } else
588 <                check_sizes();
587 >        } else if (!check_sizes())
588 >                return(1);
589          if (o_header) {                         /* write header */
590                  printargs(argc, argv, stdout);
591                  if (transpose && (no_rows <= 0) & (no_columns <= 0)) {

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines