diff options
author | Florian Weimer <fweimer@redhat.com> | 2022-12-19 18:56:55 +0100 |
---|---|---|
committer | Florian Weimer <fweimer@redhat.com> | 2022-12-19 18:56:55 +0100 |
commit | 118816de3383ff12769349784689141355cc787c (patch) | |
tree | fa858eff7a21613e38e532ac9c1d0edd1651aeab /manual | |
parent | 5365acc567a49270b4341b9d325794ec554258d9 (diff) | |
download | glibc-118816de3383ff12769349784689141355cc787c.tar.gz glibc-118816de3383ff12769349784689141355cc787c.tar.xz glibc-118816de3383ff12769349784689141355cc787c.zip |
libio: Convert __vswprintf_internal to buffers (bug 27857)
Always null-terminate the buffer and set E2BIG if the buffer is too small. This fixes bug 27857. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Diffstat (limited to 'manual')
-rw-r--r-- | manual/stdio.texi | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/manual/stdio.texi b/manual/stdio.texi index 4aa1a2bc2d..f6319a4b8a 100644 --- a/manual/stdio.texi +++ b/manual/stdio.texi @@ -2412,9 +2412,10 @@ allocate at least @var{size} wide characters for the string @var{ws}. The return value is the number of characters generated for the given input, excluding the trailing null. If not all output fits into the -provided buffer a negative value is returned. You should try again with -a bigger output string. @emph{Note:} this is different from how -@code{snprintf} handles this situation. +provided buffer a negative value is returned, and @code{errno} is set to +@code{E2BIG}. (The setting of @code{errno} is a GNU extension.) You +should try again with a bigger output string. @emph{Note:} this is +different from how @code{snprintf} handles this situation. Note that the corresponding narrow stream function takes fewer parameters. @code{swprintf} in fact corresponds to the @code{snprintf} |