1
0
mirror of https://sourceware.org/git/glibc.git synced 2025-08-05 19:35:52 +03:00

libio: Convert __vdprintf_internal to buffers

The internal buffer size is set to 2048 bytes.  This is less than
the original BUFSIZ value used by buffered_vfprintf before
the conversion, but it hopefully covers all cases where write
boundaries matter.

Reviewed-by: Adhemerval Zanella  <adhemerval.zanella@linaro.org>
This commit is contained in:
Florian Weimer
2022-12-19 18:56:55 +01:00
parent af7f416551
commit 8ece45e4f5
3 changed files with 53 additions and 29 deletions

View File

@@ -28,6 +28,7 @@
# pragma weak __printf_buffer_flush_snprintf
# pragma weak __printf_buffer_flush_to_file
# pragma weak __printf_buffer_flush_asprintf
# pragma weak __printf_buffer_flush_dprintf
# pragma weak __printf_buffer_flush_fp
# pragma weak __printf_buffer_flush_fp_to_wide
# pragma weak __printf_buffer_flush_fphex_to_wide
@@ -53,6 +54,9 @@ __printf_buffer_do_flush (struct __printf_buffer *buf)
case __printf_buffer_mode_asprintf:
__printf_buffer_flush_asprintf ((struct __printf_buffer_asprintf *) buf);
return;
case __printf_buffer_mode_dprintf:
__printf_buffer_flush_dprintf ((struct __printf_buffer_dprintf *) buf);
return;
case __printf_buffer_mode_strfmon:
__set_errno (E2BIG);
__printf_buffer_mark_failed (buf);