diff options
Diffstat (limited to 'src/apk_defines.h')
-rw-r--r-- | src/apk_defines.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/apk_defines.h b/src/apk_defines.h index bfba275..3c72c73 100644 --- a/src/apk_defines.h +++ b/src/apk_defines.h @@ -108,6 +108,7 @@ void *apk_array_resize(void *array, size_t new_size, size_t elem_size); static inline void \ array_type_name##_copy(struct array_type_name **a, struct array_type_name *b)\ { \ + if (*a == b) return; \ *a = apk_array_resize(*a, b->num, sizeof(elem_type_name));\ memcpy((*a)->item, b->item, b->num * sizeof(elem_type_name));\ } \ |