Initialise buffers

This commit is contained in:
Shahram Najm 2023-12-23 15:12:24 +00:00
parent 21298e4489
commit 72365c5bb3
2 changed files with 3 additions and 2 deletions

View File

@ -133,6 +133,7 @@ static int unpack_string(grib_accessor* a, char* val, size_t* len)
if (v[i] > 126)
v[i] = 32;
memcpy(val, grib_handle_of_accessor(a)->buffer->data, slen);
val[i] = 0;
*len = slen;

View File

@ -100,9 +100,9 @@ GRIB_INLINE static int grib_inline_strcmp(const char* a, const char* b)
static int evaluate_long(grib_expression* g, grib_handle* h, long* lres)
{
int ret = 0;
char b1[1024];
char b1[1024] = {0,};
size_t l1 = sizeof(b1);
char b2[1024];
char b2[1024] = {0,};
size_t l2 = sizeof(b2);
const char* v1 = NULL;
const char* v2 = NULL;