diff options
author | raiz <raiz@firemail.cc> | 2016-12-27 20:18:33 +0300 |
---|---|---|
committer | raiz <raiz@firemail.cc> | 2016-12-27 20:18:33 +0300 |
commit | ba0f0998d9e782714f1007ca3e812403e5a4d0f7 (patch) | |
tree | c7fee636e6952718953b079e8a21197dde416faa /extern/concat.h | |
parent | e9f738b8b6afa1d94db666d657319e0b5647cb1f (diff) |
extern/concat.h: don't segfault if count == 0
Diffstat (limited to 'extern/concat.h')
-rw-r--r-- | extern/concat.h | 3 |
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)); |