summaryrefslogtreecommitdiff
path: root/src/util/string.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/util/string.c')
-rw-r--r--src/util/string.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/util/string.c b/src/util/string.c
index d5ad73b..c760b06 100644
--- a/src/util/string.c
+++ b/src/util/string.c
@@ -4,6 +4,8 @@
#include <stdlib.h>
#include <string.h>
+#include <stdint.h>
+
#ifndef HAVE_STRDUP
char *strdup(const char *s) {
if (NULL == s) {
@@ -143,12 +145,12 @@ size_t strsplit(const char *restrict in, const char *restrict sep, void *buf) {
if (arr) {
/* update array pointers */
for (int j = 0; j < i; j++) {
- arr[j] = (char *)((size_t)buf + strtokoffset + (size_t)arr[j]);
+ arr[j] = (char *)((uintptr_t)buf + strtokoffset + (size_t)arr[j]);
}
arr[i] = NULL; /* NULL termination */
/* copy tokenized string from tmp to the back of buf */
- (void)memcpy(buf + strtokoffset, tmp, strtoklen);
+ (void)memcpy((void *)((uintptr_t)buf + strtokoffset), tmp, strtoklen);
}
free(tmp);