diff options
-rw-r--r-- | src/apk_defines.h | 2 | ||||
-rw-r--r-- | src/common.c | 6 |
2 files changed, 4 insertions, 4 deletions
diff --git a/src/apk_defines.h b/src/apk_defines.h index 90ad3a0a2a..bfba275a2e 100644 --- a/src/apk_defines.h +++ b/src/apk_defines.h @@ -87,7 +87,7 @@ void *apk_array_resize(void *array, size_t new_size, size_t elem_size); #define APK_ARRAY(array_type_name, elem_type_name) \ struct array_type_name { \ - int num; \ + size_t num; \ elem_type_name item[]; \ }; \ static inline void \ diff --git a/src/common.c b/src/common.c index 725f1c4e41..5e6e793ab9 100644 --- a/src/common.c +++ b/src/common.c @@ -31,11 +31,11 @@ void *apk_array_resize(void *array, size_t new_size, size_t elem_size) if (array == &dummy_array) array = NULL; - tmp = realloc(array, sizeof(int) + new_size * elem_size); + tmp = realloc(array, sizeof(size_t) + new_size * elem_size); if (diff > 0) - memset(tmp + sizeof(int) + old_size * elem_size, 0, + memset(tmp + sizeof(size_t) + old_size * elem_size, 0, diff * elem_size); - *((int*) tmp) = new_size; + *((size_t*) tmp) = new_size; return tmp; } |