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

vlistCopyFlag: copy datatype (bug fix).

parent e7b454a4
......@@ -3,6 +3,10 @@
* using CGRIBEX library version 1.9.0
* Version 1.9.1 released
2017-09-20 Uwe Schulzweida
* vlistCopyFlag: copy datatype (bug fix)
2017-09-20 Uwe Schulzweida
* Added support for CDI_FILETYPE_NC5
......
......@@ -535,21 +535,17 @@ void vlistCopyFlag(int vlistID2, int vlistID1)
if ( vlistptr1->vars )
{
int nvars = vlistptr1->nvars;
int nvars2 = 0;
vlistptr2->ngrids = 0;
vlistptr2->nzaxis = 0;
int nvars = vlistptr1->nvars;
int nvars2 = 0;
for ( int varID = 0; varID < nvars; varID++ )
nvars2 += vars1[varID].flag;
vlistptr2->nvars = nvars2;
vlistptr2->varsAllocated = nvars2;
if ( nvars2 > 0 )
vars2 = (var_t *) Malloc((size_t)nvars2*sizeof(var_t));
else
vars2 = NULL;
vars2 = (nvars2 > 0) ? (var_t *) Malloc((size_t)nvars2*sizeof(var_t)) : NULL;
vlistptr2->vars = vars2;
......@@ -686,6 +682,7 @@ void vlistCopyFlag(int vlistID2, int vlistID1)
zaxisDefLongname(zaxisID2, ctemp);
zaxisInqUnits(zaxisID, ctemp);
zaxisDefUnits(zaxisID2, ctemp);
zaxisDefPrec(zaxisID2, zaxisInqPrec(zaxisID));
if ( zaxisType == ZAXIS_CHAR )
{
......
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