summaryrefslogtreecommitdiff
path: root/source4/lib/util_strlist.c
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2005-02-08 01:02:56 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:09:35 -0500
commitf6f70999ca355072aa582545f0b72ca7c91df0a6 (patch)
treefa4f7e9a3f2b7cf1dc7ae8d6bc4310c822f01e40 /source4/lib/util_strlist.c
parent579d40052ca988a67f5eb64343948bf1b2c07175 (diff)
downloadsamba-f6f70999ca355072aa582545f0b72ca7c91df0a6.tar.gz
samba-f6f70999ca355072aa582545f0b72ca7c91df0a6.tar.bz2
samba-f6f70999ca355072aa582545f0b72ca7c91df0a6.zip
r5274: fixed some const warnings by making the str_list_ functions return "const char **"
(This used to be commit 4165f2163530c7d2ffbea2922fbfe942eee85e7a)
Diffstat (limited to 'source4/lib/util_strlist.c')
-rw-r--r--source4/lib/util_strlist.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/source4/lib/util_strlist.c b/source4/lib/util_strlist.c
index c6ccad907b..71f634f71a 100644
--- a/source4/lib/util_strlist.c
+++ b/source4/lib/util_strlist.c
@@ -25,30 +25,30 @@
separator list. The sepatator list must contain characters less than
or equal to 0x2f for this to work correctly on multi-byte strings
*/
-char **str_list_make(TALLOC_CTX *mem_ctx, const char *string, const char *sep)
+const char **str_list_make(TALLOC_CTX *mem_ctx, const char *string, const char *sep)
{
int num_elements = 0;
- char **ret = NULL;
+ const char **ret = NULL;
if (sep == NULL) {
sep = LIST_SEP;
}
- ret = talloc_realloc(mem_ctx, NULL, char *, 1);
+ ret = talloc_realloc(mem_ctx, NULL, const char *, 1);
if (ret == NULL) {
return NULL;
}
while (string && *string) {
size_t len = strcspn(string, sep);
- char **ret2;
+ const char **ret2;
if (len == 0) {
string += strspn(string, sep);
continue;
}
- ret2 = talloc_realloc(mem_ctx, ret, char *, num_elements+2);
+ ret2 = talloc_realloc(mem_ctx, ret, const char *, num_elements+2);
if (ret2 == NULL) {
talloc_free(ret);
return NULL;
@@ -84,10 +84,10 @@ size_t str_list_length(const char **list)
/*
copy a string list
*/
-char **str_list_copy(TALLOC_CTX *mem_ctx, const char **list)
+const char **str_list_copy(TALLOC_CTX *mem_ctx, const char **list)
{
int i;
- char **ret = talloc_array(mem_ctx, char *, str_list_length(list)+1);
+ const char **ret = talloc_array(mem_ctx, const char *, str_list_length(list)+1);
if (ret == NULL) return NULL;
for (i=0;list && list[i];i++) {