diff options
Diffstat (limited to 'source3/lib/util.c')
-rw-r--r-- | source3/lib/util.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/source3/lib/util.c b/source3/lib/util.c index 1d318c40a1..9e13e819be 100644 --- a/source3/lib/util.c +++ b/source3/lib/util.c @@ -3243,3 +3243,21 @@ void free_char_array(uint32 num_entries, char **entries) free(entries); } } + +BOOL add_chars_to_array(uint32 *len, char ***array, const char *name) +{ + if (len == NULL || array == NULL) + { + return False; + } + + (*array) = (char**)Realloc((*array), ((*len)+1) * sizeof((*array)[0])); + + if ((*array) != NULL) + { + (*array)[(*len)] = strdup(name); + (*len)++; + return True; + } + return True; +} |