mirror of
https://sourceware.org/git/glibc.git
synced 2025-08-08 17:42:12 +03:00
libio: Update number of written bytes in dprintf implementation
The __printf_buffer_flush_dprintf function needs to record that
the buffer has been written before reusing it. Without this
accounting, dprintf always returns zero.
Fixes commit 8ece45e4f5
("libio: Convert __vdprintf_internal to buffers").
Reviewed-by: Carlos O'Donell <carlos@redhat.com>
Tested-by: Carlos O'Donell <carlos@redhat.com>
This commit is contained in:
@@ -54,6 +54,7 @@ __printf_buffer_flush_dprintf (struct __printf_buffer_dprintf *buf)
|
||||
}
|
||||
p += ret;
|
||||
}
|
||||
buf->base.written += buf->base.write_ptr - buf->base.write_base;
|
||||
buf->base.write_ptr = buf->buf;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user