summaryrefslogtreecommitdiffstats
path: root/StringUtils.c
diff options
context:
space:
mode:
Diffstat (limited to 'StringUtils.c')
-rw-r--r--StringUtils.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/StringUtils.c b/StringUtils.c
index 0ac54b12..d7058a28 100644
--- a/StringUtils.c
+++ b/StringUtils.c
@@ -81,10 +81,7 @@ char** String_split(const char* s, char sep, int* n) {
s += size + 1;
}
if (s[0] != '\0') {
- int size = strlen(s);
- char* token = xMalloc(size + 1);
- strncpy(token, s, size + 1);
- out[ctr] = token;
+ out[ctr] = xStrdup(s);
ctr++;
}
out = xRealloc(out, sizeof(char*) * (ctr + 1));