1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-12 09:18:10 +03:00

libsmbconf: add handling of NULL strings to smbconf_find_in_array().

Michael
This commit is contained in:
Michael Adam 2008-04-15 13:50:27 +02:00
parent aba261a914
commit a5923bafe9

View File

@ -111,12 +111,14 @@ bool smbconf_find_in_array(const char *string, char **list,
{
uint32_t i;
if ((string == NULL) || (list == NULL)) {
if (list == NULL) {
return false;
}
for (i = 0; i < num_entries; i++) {
if (strequal(string, list[i])) {
if (((string == NULL) && (list[i] == NULL)) ||
strequal(string, list[i]))
{
if (entry != NULL) {
*entry = i;
}