summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorraiz <raiz@firemail.cc>2016-12-27 20:18:33 +0300
committerraiz <raiz@firemail.cc>2016-12-27 20:18:33 +0300
commitc3452b7144d58b13a103d14adf1aeb73fde759d9 (patch)
treec7fee636e6952718953b079e8a21197dde416faa
parentaf6ec364581c53f142053b57ba1140c19cdade8e (diff)
extern/concat.h: don't segfault if count == 0
-rw-r--r--extern/concat.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/extern/concat.h b/extern/concat.h
index 7f2ea46..0f3be99 100644
--- a/extern/concat.h
+++ b/extern/concat.h
@@ -11,6 +11,9 @@ ccat(const unsigned short int count, ...)
unsigned short int i;
concat[0] = '\0';
+ if (count == 0)
+ return;
+
va_start(ap, count);
for(i = 0; i < count; i++)
strlcat(concat, va_arg(ap, char *), sizeof(concat));