summaryrefslogtreecommitdiff
path: root/source4/lib
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2007-09-18 13:45:43 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 15:06:56 -0500
commitbc94aa19f30574dffcc56c98307dfab9772e6057 (patch)
treedd62191e6b50f7a892ac88bea70986bae930ad7c /source4/lib
parentc364bbbfa3441f40e3bcab76392d998163e7bf76 (diff)
downloadsamba-bc94aa19f30574dffcc56c98307dfab9772e6057.tar.gz
samba-bc94aa19f30574dffcc56c98307dfab9772e6057.tar.bz2
samba-bc94aa19f30574dffcc56c98307dfab9772e6057.zip
r25216: make talloc_append_string() a deprecated macro instead of
having it as a real function. metze (This used to be commit 2b2e8414650f4793e7fd6e7fb368383ee268948f)
Diffstat (limited to 'source4/lib')
-rw-r--r--source4/lib/talloc/talloc.c26
-rw-r--r--source4/lib/talloc/talloc.h3
2 files changed, 1 insertions, 28 deletions
diff --git a/source4/lib/talloc/talloc.c b/source4/lib/talloc/talloc.c
index ea32b3273a..4d72c0e871 100644
--- a/source4/lib/talloc/talloc.c
+++ b/source4/lib/talloc/talloc.c
@@ -1133,32 +1133,6 @@ char *talloc_strdup(const void *t, const char *p)
}
/*
- append to a talloced string
-*/
-char *talloc_append_string(const void *t, char *orig, const char *append)
-{
- char *ret;
- size_t olen = strlen(orig);
- size_t alenz;
-
- if (!append)
- return orig;
-
- alenz = strlen(append) + 1;
-
- ret = talloc_realloc(t, orig, char, olen + alenz);
- if (!ret)
- return NULL;
-
- /* append the string with the trailing \0 */
- memcpy(&ret[olen], append, alenz);
-
- _talloc_set_name_const(ret, ret);
-
- return ret;
-}
-
-/*
strndup with a talloc
*/
char *talloc_strndup(const void *t, const char *p, size_t n)
diff --git a/source4/lib/talloc/talloc.h b/source4/lib/talloc/talloc.h
index 72af4dbfa8..e103391681 100644
--- a/source4/lib/talloc/talloc.h
+++ b/source4/lib/talloc/talloc.h
@@ -111,6 +111,7 @@ typedef void TALLOC_CTX;
#define talloc_array_p(ctx, type, count) talloc_array(ctx, type, count)
#define talloc_realloc_p(ctx, p, type, count) talloc_realloc(ctx, p, type, count)
#define talloc_destroy(ctx) talloc_free(ctx)
+#define talloc_append_string(c, s, a) (s?talloc_strdup_append(s,a):talloc_strdup(c, a))
#endif
/* The following definitions come from talloc.c */
@@ -178,6 +179,4 @@ char *talloc_asprintf(const void *t, const char *fmt, ...) PRINTF_ATTRIBUTE(2,3)
char *talloc_asprintf_append(char *s, const char *fmt, ...) PRINTF_ATTRIBUTE(2,3);
char *talloc_asprintf_append_buffer(char *s, const char *fmt, ...) PRINTF_ATTRIBUTE(2,3);
-char *talloc_append_string(const void *t, char *orig, const char *append);
-
#endif