summaryrefslogtreecommitdiffstats
path: root/src/util
diff options
context:
space:
mode:
authorPavel Březina <pbrezina@redhat.com>2016-02-15 11:57:02 +0100
committerJakub Hrozek <jhrozek@redhat.com>2016-03-14 17:34:35 +0100
commit3a12f5cf2ee4a76c13b4d5ed9b0be87ad1d5cb2e (patch)
treeb88d516ab003162133b7e7b97612112f5d9fbe4c /src/util
parent8be4efb91f9af1bf49628c497a9de4b258bb893e (diff)
downloadsssd-3a12f5cf2ee4a76c13b4d5ed9b0be87ad1d5cb2e.tar.gz
sssd-3a12f5cf2ee4a76c13b4d5ed9b0be87ad1d5cb2e.tar.xz
sssd-3a12f5cf2ee4a76c13b4d5ed9b0be87ad1d5cb2e.zip
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 <jhrozek@redhat.com>
Diffstat (limited to 'src/util')
-rw-r--r--src/util/util.c6
-rw-r--r--src/util/util.h2
2 files changed, 4 insertions, 4 deletions
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