mirror of
https://github.com/pikami/slstatus.git
synced 2024-11-27 22:05:42 +00:00
extern/concat.h: don't segfault if count == 0
This commit is contained in:
parent
e9f738b8b6
commit
ba0f0998d9
3
extern/concat.h
vendored
3
extern/concat.h
vendored
@ -11,6 +11,9 @@ ccat(const unsigned short int count, ...)
|
|||||||
unsigned short int i;
|
unsigned short int i;
|
||||||
concat[0] = '\0';
|
concat[0] = '\0';
|
||||||
|
|
||||||
|
if (count == 0)
|
||||||
|
return;
|
||||||
|
|
||||||
va_start(ap, count);
|
va_start(ap, count);
|
||||||
for(i = 0; i < count; i++)
|
for(i = 0; i < count; i++)
|
||||||
strlcat(concat, va_arg(ap, char *), sizeof(concat));
|
strlcat(concat, va_arg(ap, char *), sizeof(concat));
|
||||||
|
Loading…
Reference in New Issue
Block a user