summaryrefslogtreecommitdiff
path: root/src/common.c
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/common.c
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/common.c')
-rw-r--r--src/common.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/common.c b/src/common.c
index 5e6e793..36c4d07 100644
--- a/src/common.c
+++ b/src/common.c
@@ -10,13 +10,15 @@
#include <malloc.h>
#include <string.h>
+#include <unistd.h>
#include "apk_defines.h"
static int *dummy_array = 0;
void *apk_array_resize(void *array, size_t new_size, size_t elem_size)
{
- int old_size, diff;
+ size_t old_size;
+ ssize_t diff;
void *tmp;
if (new_size == 0) {
@@ -25,7 +27,7 @@ void *apk_array_resize(void *array, size_t new_size, size_t elem_size)
return &dummy_array;
}
- old_size = array ? *((int*) array) : 0;
+ old_size = array ? *((size_t *) array) : 0;
diff = new_size - old_size;
if (array == &dummy_array)