From d5e3f86ecef324415a056737b94d80510a22118f Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Wed, 24 May 2006 07:45:19 +0000 Subject: r15856: fixed talloc_asprintf_append() on solaris (This used to be commit bba33a976b1954b5e9e557c9323afc92616439a3) --- source4/lib/talloc/talloc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'source4/lib') diff --git a/source4/lib/talloc/talloc.c b/source4/lib/talloc/talloc.c index b34369cb16..d480cc2689 100644 --- a/source4/lib/talloc/talloc.c +++ b/source4/lib/talloc/talloc.c @@ -1066,6 +1066,7 @@ char *talloc_vasprintf_append(char *s, const char *fmt, va_list ap) struct talloc_chunk *tc; int len, s_len; va_list ap2; + char c; if (s == NULL) { return talloc_vasprintf(NULL, fmt, ap); @@ -1076,7 +1077,7 @@ char *talloc_vasprintf_append(char *s, const char *fmt, va_list ap) va_copy(ap2, ap); s_len = tc->size - 1; - if ((len = vsnprintf(NULL, 0, fmt, ap2)) <= 0) { + if ((len = vsnprintf(&c, 1, fmt, ap2)) <= 0) { /* Either the vsnprintf failed or the format resulted in * no characters being formatted. In the former case, we * ought to return NULL, in the latter we ought to return -- cgit