summaryrefslogtreecommitdiff
path: root/src/apk_defines.h
diff options
context:
space:
mode:
authorTimo Teräs <timo.teras@iki.fi>2021-08-23 15:47:22 +0300
committerTimo Teräs <timo.teras@iki.fi>2021-08-23 17:02:50 +0300
commit74361938857d62149a93e992fb8edccc5a322b4a (patch)
treee7d7ea2d9aced804eef7b064a82820fcd7b27ca6 /src/apk_defines.h
parent99fa1fb797995fb5857f7604f90033b08ebf430c (diff)
downloadapk-tools-74361938857d62149a93e992fb8edccc5a322b4a.tar.gz
apk-tools-74361938857d62149a93e992fb8edccc5a322b4a.tar.bz2
apk-tools-74361938857d62149a93e992fb8edccc5a322b4a.tar.xz
apk-tools-74361938857d62149a93e992fb8edccc5a322b4a.zip
mkpkg: add support for scripts and triggers
Diffstat (limited to 'src/apk_defines.h')
-rw-r--r--src/apk_defines.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/apk_defines.h b/src/apk_defines.h
index d98a28d..395958b 100644
--- a/src/apk_defines.h
+++ b/src/apk_defines.h
@@ -211,7 +211,7 @@ void *apk_array_resize(void *array, size_t new_size, size_t elem_size);
static inline elem_type_name * \
array_type_name##_add(struct array_type_name **a) \
{ \
- int size = 1 + (*a)->num; \
+ int size = 1 + ((*a) ? (*a)->num : 0); \
*a = apk_array_resize(*a, size, sizeof(elem_type_name));\
return &(*a)->item[size-1]; \
}