summaryrefslogtreecommitdiff
path: root/src/apk_defines.h
diff options
context:
space:
mode:
authorTimo Teräs <timo.teras@iki.fi>2012-01-06 10:25:28 +0200
committerTimo Teräs <timo.teras@iki.fi>2012-01-06 10:25:28 +0200
commitbbc31806b9008b4756757f76615220400f4178a6 (patch)
treef90d61e5ad3e2ff8225f3f6b49dc2aa1b3b59a3e /src/apk_defines.h
parenta80cdfe95b26cdcaa4b848eb8114fb2361078063 (diff)
downloadapk-tools-bbc31806b9008b4756757f76615220400f4178a6.tar.gz
apk-tools-bbc31806b9008b4756757f76615220400f4178a6.tar.bz2
apk-tools-bbc31806b9008b4756757f76615220400f4178a6.tar.xz
apk-tools-bbc31806b9008b4756757f76615220400f4178a6.zip
common: fix apk_array copying, and additional size_t fixes
Diffstat (limited to 'src/apk_defines.h')
-rw-r--r--src/apk_defines.h1
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));\
} \