From c6ccfeb9cb78a95048ce0d91317b5948ae4ca46e Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Wed, 10 Jan 2007 11:47:27 +0000 Subject: r20649: fixed strlower_talloc() and strupper_talloc() to end with right size, so talloc_append_string() works (This used to be commit 0d36b036b381d4f81a22ce31066d89932d73597b) --- source4/lib/charset/util_unistr.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'source4/lib') diff --git a/source4/lib/charset/util_unistr.c b/source4/lib/charset/util_unistr.c index 7e1b08ca3e..e2c9015d1d 100644 --- a/source4/lib/charset/util_unistr.c +++ b/source4/lib/charset/util_unistr.c @@ -510,6 +510,9 @@ _PUBLIC_ char *strlower_talloc(TALLOC_CTX *ctx, const char *src) dest[size] = 0; + /* trim it so talloc_append_string() works */ + dest = talloc_realloc_size(ctx, dest, size+1); + return dest; } @@ -549,6 +552,9 @@ _PUBLIC_ char *strupper_talloc(TALLOC_CTX *ctx, const char *src) dest[size] = 0; + /* trim it so talloc_append_string() works */ + dest = talloc_realloc_size(ctx, dest, size+1); + return dest; } -- cgit