From 0d69740231b8154e1b70c730f2676ba68b76de5f Mon Sep 17 00:00:00 2001 From: Luke Benstead Date: Tue, 21 Aug 2018 15:50:27 +0100 Subject: [PATCH] Fix a subtle bug in NamedArray (thanks @Chilly Willy!) --- containers/named_array.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/containers/named_array.c b/containers/named_array.c index e9029e6..7ddfc7e 100644 --- a/containers/named_array.c +++ b/containers/named_array.c @@ -26,7 +26,7 @@ void named_array_init(NamedArray* array, unsigned int element_size, unsigned int array->elements = (unsigned char*) malloc(element_size * max_elements); array->used_markers = (unsigned char*) malloc(array->marker_count); #endif - memset(array->used_markers, 0, sizeof(array->marker_count)); + memset(array->used_markers, 0, sizeof(unsigned char) * array->marker_count); } char named_array_used(NamedArray* array, unsigned int id) {