mirror of
git://sourceware.org/git/newlib-cygwin.git
synced 2025-02-04 05:20:26 +08:00
9638c07527
The width value keeps the maximum field width. This is the maximum field width of the *input*. It's *never* to be used in conjunction with the number of bytes or characters written to the output argument. However, especially in vfwscanf, the code is partially taken from NetBSD which erroneously subtracts the number of multibyte chars written to the argument from the width variable, thus potentially subtracting up to MB_CUR_MAX from width for a single character in the input stream. To make matters worse, the previous patch adding %m added basically the same mistake for 'c' type input. Fix it. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>