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

Comparing ray/src/util/cmatrix.c (file contents):
Revision 2.33 by greg, Fri Jan 22 16:19:15 2021 UTC vs.
Revision 2.34 by greg, Fri Mar 11 17:15:42 2022 UTC

# Line 240 | Line 240 | cm_load(const char *inspec, int nrows, int ncols, int
240   #endif
241          if (dtype != DTascii)
242                  SET_FILE_BINARY(fp);            /* doesn't really work */
243 <        if (!dtype | !ncols) {                  /* expecting header? */
243 >        if (!dtype | !nrows | !ncols) {         /* expecting header? */
244                  char    *err = cm_getheader(&dtype, &nrows, &ncols, &swap, scale, fp);
245                  if (err)
246                          error(USER, err);
247          }
248 <        if (ncols <= 0 && !fscnresolu(&ncols, &nrows, fp))
249 <                error(USER, "unspecified number of columns");
248 >        if (!nrows | !ncols && !fscnresolu(&ncols, &nrows, fp))
249 >                error(USER, "unspecified matrix size");
250          switch (dtype) {
251          case DTascii:
252          case DTfloat:

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines