From 64eeda9072d85e236fde950f59ee765dae9a8abf Mon Sep 17 00:00:00 2001 From: Gregor Weiss Date: Thu, 7 Nov 2024 13:42:16 +0100 Subject: [PATCH] bug fix; wrong size in memcpy --- src/interfaces/reader/eas3.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/interfaces/reader/eas3.c b/src/interfaces/reader/eas3.c index f3e2985..4ab8203 100644 --- a/src/interfaces/reader/eas3.c +++ b/src/interfaces/reader/eas3.c @@ -401,13 +401,13 @@ bwc_to_eas3(bwc_stream *const stream, eas3_data *const data) { data->field.d = NULL; 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) { data->field.f = NULL; 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;