Fix compliance with classic model

h5->nvars is unused; the variable count is maintainted in grp->nvars

  An alternate fix may be to maintain a global var count (sum of all groups)
  in h5->nvars.

  Since h5->nvars does not seem to be used, possibly remove from the struct.
This commit is contained in:
Greg Sjaardema 2015-11-11 15:58:20 -05:00
parent eb9e76ae69
commit 513e10d057

View File

@ -391,8 +391,8 @@ nc_def_var_nc4(int ncid, const char *name, nc_type xtype,
BAIL(NC_EINVAL);
/* Classic model files have a limit on number of vars. */
if(h5->cmode & NC_CLASSIC_MODEL && h5->nvars >= NC_MAX_VARS)
BAIL(NC_EMAXVARS);
if(h5->cmode & NC_CLASSIC_MODEL && grp->nvars >= NC_MAX_VARS)
BAIL(NC_EMAXVARS);
/* Check that this name is not in use as a var, grp, or type. */
if ((retval = nc4_check_dup_name(grp, norm_name)))