Merge pull request #862 from Unidata/gh861.wif

Corrected overflow error in support of https://github.com/Unidata/net
This commit is contained in:
Ward Fisher 2018-02-13 15:22:45 -07:00 committed by GitHub
commit 8ebb2fff8b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -26,7 +26,7 @@ main(int argc, char **argv)
{
int ncid, dimids[NUM_DIMS];
int varid;
int nvars_in, varids_in[NUM_VARS];
int nvars_in, varids_in[NUM_VARS] = {0};
signed char fill_value = 42, fill_value_in;
nc_type xtype_in;
size_t len_in;
@ -777,6 +777,7 @@ main(int argc, char **argv)
int dimids[NDIMS5], dimids_in[NDIMS5];
int varid, varid1, varid2, varid3, varid4;
int varids_in4[NVAR4] = {0};
int ndims, nvars, natts, unlimdimid;
nc_type xtype_in;
char name_in[NC_MAX_NAME + 1];
@ -959,9 +960,9 @@ main(int argc, char **argv)
if (nc_inq(ncid, &ndims, &nvars, &natts, &unlimdimid)) ERR;
if (ndims != NDIMS5 || nvars != NVAR4 || natts != 0 ||
unlimdimid != -1) ERR;
if (nc_inq_varids(ncid, &nvars, varids_in)) ERR;
if (nc_inq_varids(ncid, &nvars, varids_in4)) ERR;
if (nvars != NVAR4) ERR;
if (varids_in[0] != 0 || varids_in[1] != 1) ERR;
if (varids_in4[0] != 0 || varids_in4[1] != 1) ERR;
if (nc_inq_var(ncid, 0, name_in, &xtype_in, &ndims, dimids_in, &natts)) ERR;
if (strcmp(name_in, VAR_NAME5) || xtype_in != NC_INT || ndims != 1 || natts != 0 ||
dimids_in[0] != 0) ERR;