coverity: Try to make it happier with our array handling

parent a262569c
......@@ -64,6 +64,8 @@ static int add_to_simple_array(char ***array, ssize_t *capacity, char *value)
{
ssize_t count = 0;
assert(array);
if (*array)
for (; (*array)[count]; count++);
......@@ -78,8 +80,9 @@ static int add_to_simple_array(char ***array, ssize_t *capacity, char *value)
*capacity = new_capacity;
}
if (array)
(*array)[count] = value;
assert(*array);
(*array)[count] = value;
return 0;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment