Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
mpim-sw
libcdi
Commits
6055003a
Commit
6055003a
authored
Jul 07, 2011
by
Uwe Schulzweida
Browse files
vlistCopy: allocate and copy varsAllocated elements (bug fix)
parent
bde5460d
Changes
2
Hide whitespace changes
Inline
Side-by-side
ChangeLog
View file @
6055003a
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]
...
...
src/vlist.c
View file @
6055003a
...
...
@@ -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
++
)
{
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment