libio: Update number of written bytes in dprintf implementation
authorFlorian Weimer <fweimer@redhat.com>
Tue, 31 Jan 2023 21:22:02 +0000 (22:22 +0100)
committerFlorian Weimer <fweimer@redhat.com>
Tue, 31 Jan 2023 21:22:02 +0000 (22:22 +0100)
commitf5c65fa920d78cffe56fe4065f16241637808353
tree0265b2fc8b7f69e366f418a86b3eb0976ea24300
parent2f39e44a8417b4186a7f15bfeac5d0b557e63e03
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 8ece45e4f586abd212d1c02d74d38ef681a45600
("libio: Convert __vdprintf_internal to buffers").

Reviewed-by: Carlos O'Donell <carlos@redhat.com>
Tested-by: Carlos O'Donell <carlos@redhat.com>
libio/iovdprintf.c
stdio-common/Makefile
stdio-common/tst-dprintf-length.c [new file with mode: 0644]