diff options
author | Jeremy Allison <jra@samba.org> | 2007-09-14 23:21:00 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 15:06:46 -0500 |
commit | 9a012df08ee829c1d40fc88ba12a0ea479f60be0 (patch) | |
tree | 98fc38abc69111d06d29b0f7c57a5f3372bdcbed /source4/lib | |
parent | 6f37a17d4a66c67de974cec14ebdf627114a397e (diff) | |
download | samba-9a012df08ee829c1d40fc88ba12a0ea479f60be0.tar.gz samba-9a012df08ee829c1d40fc88ba12a0ea479f60be0.tar.bz2 samba-9a012df08ee829c1d40fc88ba12a0ea479f60be0.zip |
r25175: Change to talloc_asprintf_append_buffer().
Jeremy.
(This used to be commit 0844dbf597191b3e4d35a696695b229e986daec4)
Diffstat (limited to 'source4/lib')
-rw-r--r-- | source4/lib/talloc/testsuite.c | 8 | ||||
-rw-r--r-- | source4/lib/util/util_strlist.c | 6 |
2 files changed, 7 insertions, 7 deletions
diff --git a/source4/lib/talloc/testsuite.c b/source4/lib/talloc/testsuite.c index ddf6865b1a..e16c91f8b9 100644 --- a/source4/lib/talloc/testsuite.c +++ b/source4/lib/talloc/testsuite.c @@ -419,15 +419,15 @@ static bool test_misc(void) p2 = talloc_strndup(p1, "foo", 2); torture_assert("misc", strcmp("fo", p2) == 0, "strndup doesn't work\n"); - p2 = talloc_asprintf_append(p2, "o%c", 'd'); + p2 = talloc_asprintf_append_buffer(p2, "o%c", 'd'); torture_assert("misc", strcmp("food", p2) == 0, - "talloc_asprintf_append doesn't work\n"); + "talloc_asprintf_append_buffer doesn't work\n"); CHECK_BLOCKS("misc", p2, 1); CHECK_BLOCKS("misc", p1, 3); - p2 = talloc_asprintf_append(NULL, "hello %s", "world"); + p2 = talloc_asprintf_append_buffer(NULL, "hello %s", "world"); torture_assert("misc", strcmp("hello world", p2) == 0, - "talloc_asprintf_append doesn't work\n"); + "talloc_asprintf_append_buffer doesn't work\n"); CHECK_BLOCKS("misc", p2, 1); CHECK_BLOCKS("misc", p1, 3); talloc_free(p2); diff --git a/source4/lib/util/util_strlist.c b/source4/lib/util/util_strlist.c index ed4ab00031..1f1cc17d00 100644 --- a/source4/lib/util/util_strlist.c +++ b/source4/lib/util/util_strlist.c @@ -151,7 +151,7 @@ _PUBLIC_ char *str_list_join(TALLOC_CTX *mem_ctx, const char **list, char sepera ret = talloc_strdup(mem_ctx, list[0]); for (i = 1; list[i]; i++) { - ret = talloc_asprintf_append(ret, "%c%s", seperator, list[i]); + ret = talloc_asprintf_append_buffer(ret, "%c%s", seperator, list[i]); } return ret; @@ -174,9 +174,9 @@ _PUBLIC_ char *str_list_join_shell(TALLOC_CTX *mem_ctx, const char **list, char for (i = 1; list[i]; i++) { if (strchr(list[i], ' ') || strlen(list[i]) == 0) - ret = talloc_asprintf_append(ret, "%c\"%s\"", sep, list[i]); + ret = talloc_asprintf_append_buffer(ret, "%c\"%s\"", sep, list[i]); else - ret = talloc_asprintf_append(ret, "%c%s", sep, list[i]); + ret = talloc_asprintf_append_buffer(ret, "%c%s", sep, list[i]); } return ret; |