aboutsummaryrefslogtreecommitdiff
path: root/snag
diff options
context:
space:
mode:
authorJack Jamison <jackqjamison@gmail.com>2026-07-22 08:15:39 -0400
committerJack Jamison <jackqjamison@gmail.com>2026-07-22 08:15:39 -0400
commit165816f7854340c3ca09287aee66968777af61ad (patch)
treefd6dcd50037af9e365e040ac3e897260656c85e1 /snag
parent2d1c5db52be9cde9e013a724c149d7a84fe057ba (diff)
todos
Diffstat (limited to 'snag')
-rw-r--r--snag/util.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/snag/util.c b/snag/util.c
index 57a31a4..9a962b0 100644
--- a/snag/util.c
+++ b/snag/util.c
@@ -56,9 +56,11 @@ char* vastrcat_(int dummy, ...) {
if (!output) return NULL;
char* p = output;
while ((arg = va_arg(args, char*))) {
- memcpy(p, arg, strlen(arg));
- p += strlen(arg);
+ size_t alen = strlen(arg);
+ memcpy(p, arg, alen);
+ p += alen;
}
+ output[len] = '\0';
va_end(args2);
return output;