Commit cfeaddd1 authored by Uwe Schulzweida's avatar Uwe Schulzweida
Browse files

Preserve NetCDF attribute positive on data variables.

parent 05b9e160
......@@ -1143,7 +1143,7 @@ void cdfScanVarAttr(int nvars, ncvar_t *ncvars, int ndims, ncdim_t *ncdims, int
}
}
if ( ncvars[ncvarid].natts == 0 )
if (ncvars[ncvarid].natts == 0 && nvatts > 0)
ncvars[ncvarid].atts = (int*) Malloc((size_t)nvatts*sizeof(int));
for ( iatt = 0; iatt < nvatts; iatt++ )
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment