mirror of
https://github.com/libvirt/libvirt.git
synced 2025-02-25 18:55:26 -06: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:
@@ -172,6 +172,9 @@ virStringArrayHasString(char **strings, const char *needle)
|
||||
{
|
||||
size_t i = 0;
|
||||
|
||||
if (!strings)
|
||||
return false;
|
||||
|
||||
while (strings[i]) {
|
||||
if (STREQ(strings[i++], needle))
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user