Commit 6055003a authored by Uwe Schulzweida's avatar Uwe Schulzweida
Browse files

vlistCopy: allocate and copy varsAllocated elements (bug fix)

parent bde5460d
2011-07-07 Uwe Schulzweida <Uwe.Schulzweida@zmaw.de>
* vlistCopy: allocate and copy varsAllocated elements (bug fix) [report: Ralf Mueller]
2011-06-24 Uwe Schulzweida <Uwe.Schulzweida@zmaw.de>
* vtime2timeval: do not round result (bug fix for TUNIT_YEAR) [report: Andy Aschwanden]
......
......@@ -372,8 +372,8 @@ void vlistCopy(int vlistID2, int vlistID1)
int nvars = vlistptr1->nvars;
int nlevs, varID;
vlistptr2->vars = (var_t *) malloc(nvars*sizeof(var_t));
memcpy(vlistptr2->vars, vlistptr1->vars, nvars*sizeof(var_t));
vlistptr2->vars = (var_t *) malloc(vlistptr2->varsAllocated*sizeof(var_t));
memcpy(vlistptr2->vars, vlistptr1->vars, vlistptr2->varsAllocated*sizeof(var_t));
for ( varID = 0; varID < nvars; varID++ )
{
......
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