summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Adam <obnox@samba.org>2008-04-15 13:50:27 +0200
committerMichael Adam <obnox@samba.org>2008-04-15 17:40:27 +0200
commit0e7497936ce71a65af00ac08fa372082310c2fba (patch)
treeb567cac09750f11a87c0e59c9dc1129561331d45
parentb396ad07d131fba4945060b35c870abec626cbc8 (diff)
downloadsamba-0e7497936ce71a65af00ac08fa372082310c2fba.tar.gz
samba-0e7497936ce71a65af00ac08fa372082310c2fba.tar.bz2
samba-0e7497936ce71a65af00ac08fa372082310c2fba.zip
libsmbconf: add handling of NULL strings to smbconf_find_in_array().
Michael (This used to be commit a5923bafe9b543d50dca06d251186948baeac8cc)
-rw-r--r--source3/lib/smbconf/smbconf_util.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/source3/lib/smbconf/smbconf_util.c b/source3/lib/smbconf/smbconf_util.c
index 20bd51a62b..b2e253dd26 100644
--- a/source3/lib/smbconf/smbconf_util.c
+++ b/source3/lib/smbconf/smbconf_util.c
@@ -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;
}