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:
+1
-1
@@ -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))
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user