diff options
author | Jelmer Vernooij <jelmer@samba.org> | 2008-04-15 20:52:17 +0200 |
---|---|---|
committer | Jelmer Vernooij <jelmer@samba.org> | 2008-04-15 20:52:17 +0200 |
commit | d0b946e328c25b8e2bdfef58e11bc3badad97f1c (patch) | |
tree | ca63d963f6db36f935aa591500db9741db4d58b8 /source3/lib/smbconf/smbconf_util.c | |
parent | 28fd4f6fcb101fc0274c43611a59d22072fb7891 (diff) | |
parent | b64be89a6ddd1b9c62df98801f34f4d9116a06bf (diff) | |
download | samba-d0b946e328c25b8e2bdfef58e11bc3badad97f1c.tar.gz samba-d0b946e328c25b8e2bdfef58e11bc3badad97f1c.tar.bz2 samba-d0b946e328c25b8e2bdfef58e11bc3badad97f1c.zip |
Merge branch 'v3-2-test' of ssh://git.samba.org/data/git/samba into 3-2-nopipeindex
(This used to be commit 9028f9e065536594df901ae4aac900102f2d85f6)
Diffstat (limited to 'source3/lib/smbconf/smbconf_util.c')
-rw-r--r-- | source3/lib/smbconf/smbconf_util.c | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/source3/lib/smbconf/smbconf_util.c b/source3/lib/smbconf/smbconf_util.c index 1a3a0ded44..b2e253dd26 100644 --- a/source3/lib/smbconf/smbconf_util.c +++ b/source3/lib/smbconf/smbconf_util.c @@ -82,7 +82,7 @@ WERROR smbconf_add_string_to_array(TALLOC_CTX *mem_ctx, { char **new_array = NULL; - if ((array == NULL) || (string == NULL)) { + if (array == NULL) { return WERR_INVALID_PARAM; } @@ -91,10 +91,14 @@ WERROR smbconf_add_string_to_array(TALLOC_CTX *mem_ctx, return WERR_NOMEM; } - new_array[count] = talloc_strdup(new_array, string); - if (new_array[count] == NULL) { - TALLOC_FREE(new_array); - return WERR_NOMEM; + if (string == NULL) { + new_array[count] = NULL; + } else { + new_array[count] = talloc_strdup(new_array, string); + if (new_array[count] == NULL) { + TALLOC_FREE(new_array); + return WERR_NOMEM; + } } *array = new_array; @@ -107,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; } |