1
0
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:
Jiri Denemark 2013-07-19 14:55:41 +02:00
parent bfc183c1e3
commit 09e9f28118

View File

@ -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;