mirror of
https://github.com/MidnightCommander/mc
synced 2025-01-03 18:14:25 +03:00
Call va_end after the iteration as we need to free the list again.
Signed-off-by: Patrick Winnertz <winnie@debian.org>
This commit is contained in:
parent
f148fc29d2
commit
51388bd012
@ -71,7 +71,7 @@ static inline char* __mhl_str_concat_hlp(const char* base, ...)
|
|||||||
va_start(args,base);
|
va_start(args,base);
|
||||||
char* a;
|
char* a;
|
||||||
/* note: we use ((char*)(1)) as terminator - NULL is a valid argument ! */
|
/* note: we use ((char*)(1)) as terminator - NULL is a valid argument ! */
|
||||||
while ((a = va_arg(args, char*))!=(char*)1 && count <= 31 )
|
while ((a = va_arg(args, char*))!=(char*)1 && count < __STR_CONCAT_MAX )
|
||||||
{
|
{
|
||||||
if (a)
|
if (a)
|
||||||
{
|
{
|
||||||
@ -81,6 +81,7 @@ static inline char* __mhl_str_concat_hlp(const char* base, ...)
|
|||||||
count++;
|
count++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
va_end(args);
|
||||||
|
|
||||||
if (!count)
|
if (!count)
|
||||||
return mhl_str_dup("");
|
return mhl_str_dup("");
|
||||||
|
Loading…
Reference in New Issue
Block a user