From ba0f0998d9e782714f1007ca3e812403e5a4d0f7 Mon Sep 17 00:00:00 2001 From: raiz Date: Tue, 27 Dec 2016 20:18:33 +0300 Subject: extern/concat.h: don't segfault if count == 0 --- extern/concat.h | 3 +++ 1 file changed, 3 insertions(+) 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)); -- cgit v1.2.3