avoid calling NC3_inq_var_fill when ERANGE_FILL is enabled

This commit is contained in:
Wei-keng Liao 2017-08-20 02:04:29 -05:00
parent 80318f6413
commit 2a68d58433

View File

@ -704,15 +704,15 @@ putNCvx_$1_$2(NC3_INFO* ncp, const NC_var *varp,
size_t remaining = varp->xsz * nelems;
int status = NC_NOERR;
void *xp;
void *fillp;
void *fillp=NULL;
if(nelems == 0)
return NC_NOERR;
assert(value != NULL);
fillp = malloc(varp->xsz);
status = NC3_inq_var_fill(varp, fillp);
ifdef(`ERANGE_FILL',`fillp = malloc(varp->xsz);
status = NC3_inq_var_fill(varp, fillp);')
for(;;)
{
@ -741,7 +741,7 @@ putNCvx_$1_$2(NC3_INFO* ncp, const NC_var *varp,
value += nput;
}
free(fillp);
ifdef(`ERANGE_FILL',`free(fillp);')
return status;
}