Skip to content
GitLab
Menu
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
34c9155e
Commit
34c9155e
authored
Mar 28, 2020
by
Uwe Schulzweida
Browse files
streamReadRecordF: wrong elementCount for complex numbers (bug fix).
parent
56085ffe
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/stream_read.c
View file @
34c9155e
...
...
@@ -338,7 +338,8 @@ void streamReadRecordF(int streamID, float *data, size_t *nmiss)
int
vrecID
=
streamptr
->
tsteps
[
tsID
].
curRecID
;
int
recID
=
streamptr
->
tsteps
[
tsID
].
recIDs
[
vrecID
];
int
varID
=
streamptr
->
tsteps
[
tsID
].
records
[
recID
].
varID
;
size_t
elementCount
=
gridInqSize
(
vlistInqVarGrid
(
streamInqVlist
(
streamID
),
varID
));
int
nwpv
=
vlistInqVarNumber
(
streamInqVlist
(
streamID
),
varID
);
size_t
elementCount
=
nwpv
*
gridInqSize
(
vlistInqVarGrid
(
streamInqVlist
(
streamID
),
varID
));
double
*
conversionBuffer
=
(
double
*
)
Malloc
(
elementCount
*
sizeof
(
*
conversionBuffer
));
streamReadRecord
(
streamID
,
conversionBuffer
,
nmiss
);
for
(
size_t
i
=
elementCount
;
i
--
;
)
data
[
i
]
=
(
float
)
conversionBuffer
[
i
];
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a 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