libio: Flush-only _IO_str_overflow must not return EOF (bug 28949)
authorFlorian Weimer <fweimer@redhat.com>
Fri, 18 Mar 2022 20:27:54 +0000 (21:27 +0100)
committerFlorian Weimer <fweimer@redhat.com>
Fri, 18 Mar 2022 20:40:02 +0000 (21:40 +0100)
commit88ed43ff0cf2561481de7cba00686386794515d6
treedd91c58f23224c5e63b47cc961a55aa279f6c8d3
parent6fece2968a11719e8559098d29b4b9519d8cf57a
libio: Flush-only _IO_str_overflow must not return EOF (bug 28949)

In general, _IO_str_overflow returns the character passed as an argument
on success.  However, if flush-only operation is requested by passing
EOF, returning EOF looks like an error, and the caller cannot tell
whether the operation was successful or not.

_IO_wstr_overflow had the same bug regarding WEOF.

Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
libio/strops.c
libio/wstrops.c