Code quality: Fix some cppcheck messages

This commit addresses these kind of errors:

portability: Passing NULL after the last typed argument to a variadic function leads to undefined behaviour. [varFuncNullUB]

Reason is that C does not guarantee that all pointer types are the same
size. See C99 6.2.5(27). cppcheck requires some sort of cast when NULL
is used as the last argument in a variadic list.
This commit is contained in:
matt335672
2026-02-20 12:06:05 +00:00
committed by firewave
parent 94c0024c3b
commit d3bfe802cc
10 changed files with 41 additions and 31 deletions
+1 -1
View File
@@ -271,7 +271,7 @@ list_add_strdup_multi(struct list *self, ...)
int rv = 1;
va_start(ap, self);
while ((s = va_arg(ap, const char *)) != NULL)
while ((s = va_arg(ap, const char *)) != LIST_ADD_STRDUP_TERM)
{
if (!list_add_strdup(self, s))
{