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:
parent
0c9a8c4dff
commit
93c42fd9b5
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user