mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-03-07 17:28:15 +00:00
util: Non-existent string array does not contain any string
Make virStringArrayHasString return false when called on a non-existent string array.
This commit is contained in:
parent
bfc183c1e3
commit
09e9f28118
@ -172,6 +172,9 @@ virStringArrayHasString(char **strings, const char *needle)
|
|||||||
{
|
{
|
||||||
size_t i = 0;
|
size_t i = 0;
|
||||||
|
|
||||||
|
if (!strings)
|
||||||
|
return false;
|
||||||
|
|
||||||
while (strings[i]) {
|
while (strings[i]) {
|
||||||
if (STREQ(strings[i++], needle))
|
if (STREQ(strings[i++], needle))
|
||||||
return true;
|
return true;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user