1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-27 03:21:53 +03:00

r25116: Fix talloc_asprintf_append to do the right thing with

truncated strings.
Jeremy.
(This used to be commit 948d32bb62)
This commit is contained in:
Jeremy Allison 2007-09-12 21:41:36 +00:00 committed by Gerald (Jerry) Carter
parent 95b8ab07f0
commit d8a5ed33b3

View File

@ -1226,8 +1226,7 @@ char *talloc_asprintf(const void *t, const char *fmt, ...)
* accumulating output into a string buffer.
**/
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;
@ -1236,9 +1235,7 @@ char *talloc_vasprintf_append(char *s, const char *fmt, va_list ap)
return talloc_vasprintf(NULL, fmt, ap);
}
tc = talloc_chunk_from_ptr(s);
s_len = tc->size - 1;
s_len = strlen(s);
va_copy(ap2, ap);
len = vsnprintf(&c, 1, fmt, ap2);