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

r25116: Fix talloc_asprintf_append to do the right thing with

truncated strings.
Jeremy.
This commit is contained in:
Jeremy Allison 2007-09-12 21:41:36 +00:00 committed by Gerald (Jerry) Carter
parent 0c9a8c4dff
commit 93c42fd9b5

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);