bug fix; wrong size in memcpy

This commit is contained in:
Gregor Weiss 2024-11-07 13:42:16 +01:00
parent 742fb3bc78
commit 64eeda9072
Signed by: Gregor Weiss
GPG key ID: 61E170A8BBFE5756

View file

@ -401,13 +401,13 @@ bwc_to_eas3(bwc_stream *const stream, eas3_data *const data)
{ {
data->field.d = NULL; data->field.d = NULL;
data->field.f = calloc(size, sizeof(float)); data->field.f = calloc(size, sizeof(float));
memcpy(data->field.f, stream->out, size); memcpy(data->field.f, stream->out, size*sizeof(float));
} }
else if(params->accuracy == 2) else if(params->accuracy == 2)
{ {
data->field.f = NULL; data->field.f = NULL;
data->field.d = calloc(size, sizeof(double)); data->field.d = calloc(size, sizeof(double));
memcpy(data->field.d, stream->out, size); memcpy(data->field.d, stream->out, size*sizeof(double));
} }
return 0; return 0;