From 3a12f5cf2ee4a76c13b4d5ed9b0be87ad1d5cb2e Mon Sep 17 00:00:00 2001 From: Pavel Březina Date: Mon, 15 Feb 2016 11:57:02 +0100 Subject: utils: return const char ** from dup_string_list This function is not used anywhere and const char ** suits better in my use case (next patch) so I just changed the function. Reviewed-by: Jakub Hrozek --- src/util/util.c | 6 +++--- src/util/util.h | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/util/util.c b/src/util/util.c index 8c0899b06..60da88528 100644 --- a/src/util/util.c +++ b/src/util/util.c @@ -232,11 +232,11 @@ fail: return NULL; } -char **dup_string_list(TALLOC_CTX *memctx, const char **str_list) +const char **dup_string_list(TALLOC_CTX *memctx, const char **str_list) { int i = 0; int j = 0; - char **dup_list; + const char **dup_list; if (!str_list) { return NULL; @@ -245,7 +245,7 @@ char **dup_string_list(TALLOC_CTX *memctx, const char **str_list) /* Find the size of the list */ while (str_list[i]) i++; - dup_list = talloc_array(memctx, char *, i+1); + dup_list = talloc_array(memctx, const char *, i+1); if (!dup_list) { return NULL; } diff --git a/src/util/util.h b/src/util/util.h index 5df86b4cb..30713f9b5 100644 --- a/src/util/util.h +++ b/src/util/util.h @@ -479,7 +479,7 @@ errno_t sss_fd_nonblocking(int fd); /* Copy a NULL-terminated string list * Returns NULL on out of memory error or invalid input */ -char **dup_string_list(TALLOC_CTX *memctx, const char **str_list); +const char **dup_string_list(TALLOC_CTX *memctx, const char **str_list); /* Take two string lists (terminated on a NULL char*) * and return up to three arrays of strings based on -- cgit