newlib-cygwin/newlib/libc/stdio
Corinna Vinschen 9638c07527 newlib: vf[w]scanf: Drop width computation mixup
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>
2017-12-01 13:47:26 +01:00
..
Makefile.am stdio: Fix make rule override 2017-07-28 15:05:54 +02:00
Makefile.in stdio: Fix make rule override 2017-07-28 15:05:54 +02:00
asiprintf.c Throughout, run newlib with -Wall -Werror option and fix bugs and 2012-08-08 11:04:18 +00:00
asniprintf.c 2008-12-11 Craig Howland <howland@LGSInnovations.com> 2008-12-11 17:27:56 +00:00
asnprintf.c 2014-07-04 Bin Cheng <bin.cheng@arm.com> 2014-07-04 17:21:45 +00:00
asprintf.c 2014-07-04 Bin Cheng <bin.cheng@arm.com> 2014-07-04 17:21:45 +00:00
clearerr.c stdio: remove TRAD_SYNOPSIS 2017-12-01 03:41:51 -06:00
clearerr_u.c Implement BSD/GNU unlocked stdio extensions. 2014-12-18 14:55:21 +00:00
diprintf.c stdio: remove TRAD_SYNOPSIS 2017-12-01 03:41:51 -06:00
dprintf.c stdio: remove TRAD_SYNOPSIS 2017-12-01 03:41:51 -06:00
fclose.c stdio: remove TRAD_SYNOPSIS 2017-12-01 03:41:51 -06:00
fcloseall.c stdio: remove TRAD_SYNOPSIS 2017-12-01 03:41:51 -06:00
fdopen.c stdio: remove TRAD_SYNOPSIS 2017-12-01 03:41:51 -06:00
feof.c stdio: remove TRAD_SYNOPSIS 2017-12-01 03:41:51 -06:00
feof_u.c Implement BSD/GNU unlocked stdio extensions. 2014-12-18 14:55:21 +00:00
ferror.c stdio: remove TRAD_SYNOPSIS 2017-12-01 03:41:51 -06:00
ferror_u.c Implement BSD/GNU unlocked stdio extensions. 2014-12-18 14:55:21 +00:00
fflush.c stdio: remove TRAD_SYNOPSIS 2017-12-01 03:41:51 -06:00
fflush_u.c Implement BSD/GNU unlocked stdio extensions. 2014-12-18 14:55:21 +00:00
fgetc.c stdio: remove TRAD_SYNOPSIS 2017-12-01 03:41:51 -06:00
fgetc_u.c Implement BSD/GNU unlocked stdio extensions. 2014-12-18 14:55:21 +00:00
fgetpos.c stdio: remove TRAD_SYNOPSIS 2017-12-01 03:41:51 -06:00
fgets.c stdio: remove TRAD_SYNOPSIS 2017-12-01 03:41:51 -06:00
fgets_u.c Implement BSD/GNU unlocked stdio extensions. 2014-12-18 14:55:21 +00:00
fgetwc.c stdio: remove TRAD_SYNOPSIS 2017-12-01 03:41:51 -06:00
fgetwc_u.c Implement BSD/GNU unlocked stdio extensions. 2014-12-18 14:55:21 +00:00
fgetws.c stdio: remove TRAD_SYNOPSIS 2017-12-01 03:41:51 -06:00
fgetws_u.c Implement BSD/GNU unlocked stdio extensions. 2014-12-18 14:55:21 +00:00
fileno.c stdio: remove TRAD_SYNOPSIS 2017-12-01 03:41:51 -06:00
fileno_u.c Implement BSD/GNU unlocked stdio extensions. 2014-12-18 14:55:21 +00:00
findfp.c Introduce _REENT_GLOBAL_STDIO_STREAMS 2017-06-30 07:45:16 +02:00
fiprintf.c Add support for asnprintf, and improve *printf documentation. 2007-05-04 02:55:16 +00:00
fiscanf.c
flags.c * libc/stdio/flags.c (__sflags): Guard against using O_BINARY on systems which 2012-08-23 04:19:59 +00:00
floatio.h
fmemopen.c stdio: remove TRAD_SYNOPSIS 2017-12-01 03:41:51 -06:00
fopen.c stdio: remove TRAD_SYNOPSIS 2017-12-01 03:41:51 -06:00
fopencookie.c stdio: remove TRAD_SYNOPSIS 2017-12-01 03:41:51 -06:00
fprintf.c 2014-07-04 Bin Cheng <bin.cheng@arm.com> 2014-07-04 17:21:45 +00:00
fpurge.c stdio: remove TRAD_SYNOPSIS 2017-12-01 03:41:51 -06:00
fputc.c stdio: remove TRAD_SYNOPSIS 2017-12-01 03:41:51 -06:00
fputc_u.c Implement BSD/GNU unlocked stdio extensions. 2014-12-18 14:55:21 +00:00
fputs.c stdio: remove TRAD_SYNOPSIS 2017-12-01 03:41:51 -06:00
fputs_u.c Implement BSD/GNU unlocked stdio extensions. 2014-12-18 14:55:21 +00:00
fputwc.c stdio: remove TRAD_SYNOPSIS 2017-12-01 03:41:51 -06:00
fputwc_u.c Implement BSD/GNU unlocked stdio extensions. 2014-12-18 14:55:21 +00:00
fputws.c stdio: remove TRAD_SYNOPSIS 2017-12-01 03:41:51 -06:00
fputws_u.c Implement BSD/GNU unlocked stdio extensions. 2014-12-18 14:55:21 +00:00
fread.c stdio: remove TRAD_SYNOPSIS 2017-12-01 03:41:51 -06:00
fread_u.c Implement BSD/GNU unlocked stdio extensions. 2014-12-18 14:55:21 +00:00
freopen.c stdio: remove TRAD_SYNOPSIS 2017-12-01 03:41:51 -06:00
fscanf.c 2014-07-04 Bin Cheng <bin.cheng@arm.com> 2014-07-04 17:21:45 +00:00
fseek.c stdio: remove TRAD_SYNOPSIS 2017-12-01 03:41:51 -06:00
fseeko.c stdio: remove TRAD_SYNOPSIS 2017-12-01 03:41:51 -06:00
fsetlocking.c stdio: remove TRAD_SYNOPSIS 2017-12-01 03:41:51 -06:00
fsetpos.c stdio: remove TRAD_SYNOPSIS 2017-12-01 03:41:51 -06:00
ftell.c stdio: remove TRAD_SYNOPSIS 2017-12-01 03:41:51 -06:00
ftello.c stdio: remove TRAD_SYNOPSIS 2017-12-01 03:41:51 -06:00
funopen.c stdio: remove TRAD_SYNOPSIS 2017-12-01 03:41:51 -06:00
fvwrite.c * libc/stdio/fvwrite.c: Allow writing in larger chunks for fully 2013-11-04 14:18:44 +00:00
fvwrite.h * libc/stdio/fvwrite.h: change type of uio_resid from int to size_t to 2013-10-31 10:35:54 +00:00
fwalk.c * libc/stdio/fwalk.c (_fwalk_reent): Remove redundant test. 2014-09-05 09:31:32 +00:00
fwide.c stdio: remove TRAD_SYNOPSIS 2017-12-01 03:41:51 -06:00
fwprintf.c 2013-11-26 Julio Gutierrez <jgutleyva@gmail.com> 2013-11-26 17:21:01 +00:00
fwrite.c stdio: remove TRAD_SYNOPSIS 2017-12-01 03:41:51 -06:00
fwrite_u.c Implement BSD/GNU unlocked stdio extensions. 2014-12-18 14:55:21 +00:00
fwscanf.c 2013-11-26 Julio Gutierrez <jgutleyva@gmail.com> 2013-11-26 17:21:01 +00:00
getc.c stdio: remove TRAD_SYNOPSIS 2017-12-01 03:41:51 -06:00
getc_u.c 2008-10-31 Jeff Johnston <jjohnstn@redhat.com> 2008-10-31 21:08:03 +00:00
getchar.c stdio: remove TRAD_SYNOPSIS 2017-12-01 03:41:51 -06:00
getchar_u.c Correct a non-ANSI prototype in SYNOPSIS 2015-06-23 17:30:17 +01:00
getdelim.c stdio: remove TRAD_SYNOPSIS 2017-12-01 03:41:51 -06:00
getline.c stdio: remove TRAD_SYNOPSIS 2017-12-01 03:41:51 -06:00
gets.c stdio: remove TRAD_SYNOPSIS 2017-12-01 03:41:51 -06:00
getw.c stdio: remove TRAD_SYNOPSIS 2017-12-01 03:41:51 -06:00
getwc.c 2008-12-10 Corinna Vinschen <corinna@vinschen.de> 2008-12-10 23:43:12 +00:00
getwc_u.c Implement BSD/GNU unlocked stdio extensions. 2014-12-18 14:55:21 +00:00
getwchar.c stdio: remove TRAD_SYNOPSIS 2017-12-01 03:41:51 -06:00
getwchar_u.c Implement BSD/GNU unlocked stdio extensions. 2014-12-18 14:55:21 +00:00
iprintf.c Add support for asnprintf, and improve *printf documentation. 2007-05-04 02:55:16 +00:00
iscanf.c
local.h Enable _REENT_GLOBAL_STDIO_STREAMS for RTEMS 2017-06-30 07:45:16 +02:00
makebuf.c 2016-12-15 Giuseppe Musumeci <giuseppe.musumeci@broadcom.com> 2016-12-15 12:12:31 -05:00
mktemp.c stdio: remove TRAD_SYNOPSIS 2017-12-01 03:41:51 -06:00
nano-vfprintf.c stdio: remove TRAD_SYNOPSIS 2017-12-01 03:41:51 -06:00
nano-vfprintf_float.c 2014-07-04 Bin Cheng <bin.cheng@arm.com> 2014-07-04 17:21:45 +00:00
nano-vfprintf_i.c * libc/stdio/nano-vfprintf_i.c (_printf_i): Use LONGINT when void* is 2014-11-20 14:05:28 +00:00
nano-vfprintf_local.h 2014-07-04 Bin Cheng <bin.cheng@arm.com> 2014-07-04 17:21:45 +00:00
nano-vfscanf.c stdio: remove TRAD_SYNOPSIS 2017-12-01 03:41:51 -06:00
nano-vfscanf_float.c 2014-07-04 Bin Cheng <bin.cheng@arm.com> 2014-07-04 17:21:45 +00:00
nano-vfscanf_i.c 2014-07-04 Bin Cheng <bin.cheng@arm.com> 2014-07-04 17:21:45 +00:00
nano-vfscanf_local.h 2014-07-04 Bin Cheng <bin.cheng@arm.com> 2014-07-04 17:21:45 +00:00
open_memstream.c stdio: remove TRAD_SYNOPSIS 2017-12-01 03:41:51 -06:00
perror.c stdio: remove TRAD_SYNOPSIS 2017-12-01 03:41:51 -06:00
printf.c 2014-07-04 Bin Cheng <bin.cheng@arm.com> 2014-07-04 17:21:45 +00:00
putc.c stdio: remove TRAD_SYNOPSIS 2017-12-01 03:41:51 -06:00
putc_u.c 2008-10-31 Jeff Johnston <jjohnstn@redhat.com> 2008-10-31 21:08:03 +00:00
putchar.c stdio: remove TRAD_SYNOPSIS 2017-12-01 03:41:51 -06:00
putchar_u.c 2008-10-31 Jeff Johnston <jjohnstn@redhat.com> 2008-10-31 21:08:03 +00:00
puts.c stdio: remove TRAD_SYNOPSIS 2017-12-01 03:41:51 -06:00
putw.c stdio: remove TRAD_SYNOPSIS 2017-12-01 03:41:51 -06:00
putwc.c 2008-12-10 Corinna Vinschen <corinna@vinschen.de> 2008-12-10 23:43:12 +00:00
putwc_u.c Implement BSD/GNU unlocked stdio extensions. 2014-12-18 14:55:21 +00:00
putwchar.c stdio: remove TRAD_SYNOPSIS 2017-12-01 03:41:51 -06:00
putwchar_u.c Implement BSD/GNU unlocked stdio extensions. 2014-12-18 14:55:21 +00:00
refill.c * libc/stdio/fclose.c: Only use sfp lock to guard non-atomic 2011-01-28 10:49:11 +00:00
remove.c stdio: remove TRAD_SYNOPSIS 2017-12-01 03:41:51 -06:00
rename.c stdio: remove TRAD_SYNOPSIS 2017-12-01 03:41:51 -06:00
rewind.c stdio: remove TRAD_SYNOPSIS 2017-12-01 03:41:51 -06:00
rget.c 2008-03-11 Jeff Johnston <jjohnstn@redhat.com> 2008-03-11 19:13:30 +00:00
scanf.c 2014-07-04 Bin Cheng <bin.cheng@arm.com> 2014-07-04 17:21:45 +00:00
sccl.c
setbuf.c stdio: remove TRAD_SYNOPSIS 2017-12-01 03:41:51 -06:00
setbuffer.c stdio: remove TRAD_SYNOPSIS 2017-12-01 03:41:51 -06:00
setlinebuf.c stdio: remove TRAD_SYNOPSIS 2017-12-01 03:41:51 -06:00
setvbuf.c stdio: remove TRAD_SYNOPSIS 2017-12-01 03:41:51 -06:00
siprintf.c stdio: remove TRAD_SYNOPSIS 2017-12-01 03:41:51 -06:00
siscanf.c stdio: remove TRAD_SYNOPSIS 2017-12-01 03:41:51 -06:00
sniprintf.c 2008-04-14 Jeff Johnston <jjohnstn@redhat.com> 2008-04-14 21:14:55 +00:00
snprintf.c 2014-07-04 Bin Cheng <bin.cheng@arm.com> 2014-07-04 17:21:45 +00:00
sprintf.c stdio: remove TRAD_SYNOPSIS 2017-12-01 03:41:51 -06:00
sscanf.c stdio: remove TRAD_SYNOPSIS 2017-12-01 03:41:51 -06:00
stdio.c * libc/include/stdio.h (funopen): Change prototype of 2013-10-23 10:04:43 +00:00
stdio.tex Fix makedoc markup used in texinfo source 2015-06-23 16:14:39 +01:00
stdio_ext.c stdio: remove TRAD_SYNOPSIS 2017-12-01 03:41:51 -06:00
swprintf.c stdio: remove TRAD_SYNOPSIS 2017-12-01 03:41:51 -06:00
swscanf.c stdio: remove TRAD_SYNOPSIS 2017-12-01 03:41:51 -06:00
tmpfile.c stdio: remove TRAD_SYNOPSIS 2017-12-01 03:41:51 -06:00
tmpnam.c stdio: remove TRAD_SYNOPSIS 2017-12-01 03:41:51 -06:00
ungetc.c stdio: remove TRAD_SYNOPSIS 2017-12-01 03:41:51 -06:00
ungetwc.c stdio: remove TRAD_SYNOPSIS 2017-12-01 03:41:51 -06:00
vasiprintf.c Throughout, run newlib with -Wall -Werror option and fix bugs and 2012-08-08 11:04:18 +00:00
vasniprintf.c 2008-12-11 Craig Howland <howland@LGSInnovations.com> 2008-12-11 17:27:56 +00:00
vasnprintf.c 2014-07-04 Bin Cheng <bin.cheng@arm.com> 2014-07-04 17:21:45 +00:00
vasprintf.c 2014-07-04 Bin Cheng <bin.cheng@arm.com> 2014-07-04 17:21:45 +00:00
vdiprintf.c 2008-03-07 Jeff Johnston <jjohnstn@redhat.com> 2008-03-07 16:45:04 +00:00
vdprintf.c 2014-07-04 Bin Cheng <bin.cheng@arm.com> 2014-07-04 17:21:45 +00:00
vfieeefp.h Add __packed to struct ldieee 2017-04-18 12:25:35 +02:00
vfprintf.c stdio: remove TRAD_SYNOPSIS 2017-12-01 03:41:51 -06:00
vfscanf.c newlib: vf[w]scanf: Drop width computation mixup 2017-12-01 13:47:26 +01:00
vfwprintf.c stdio: remove TRAD_SYNOPSIS 2017-12-01 03:41:51 -06:00
vfwscanf.c newlib: vf[w]scanf: Drop width computation mixup 2017-12-01 13:47:26 +01:00
viprintf.c stdio: remove TRAD_SYNOPSIS 2017-12-01 03:41:51 -06:00
viscanf.c stdio: remove TRAD_SYNOPSIS 2017-12-01 03:41:51 -06:00
vprintf.c 2014-07-04 Bin Cheng <bin.cheng@arm.com> 2014-07-04 17:21:45 +00:00
vscanf.c 2014-07-04 Bin Cheng <bin.cheng@arm.com> 2014-07-04 17:21:45 +00:00
vsiprintf.c 2011-08-19 Ralf Corsépius <ralf.corsepius@rtems.org> 2011-08-19 17:00:32 +00:00
vsiscanf.c * libc/include/wchar.h (fwscanf, swscanf, vfwscanf, vswscanf, vwscanf, 2009-03-11 11:53:22 +00:00
vsniprintf.c 2011-08-19 Ralf Corsépius <ralf.corsepius@rtems.org> 2011-08-19 17:00:32 +00:00
vsnprintf.c 2014-07-04 Bin Cheng <bin.cheng@arm.com> 2014-07-04 17:21:45 +00:00
vsprintf.c 2014-07-04 Bin Cheng <bin.cheng@arm.com> 2014-07-04 17:21:45 +00:00
vsscanf.c 2014-07-04 Bin Cheng <bin.cheng@arm.com> 2014-07-04 17:21:45 +00:00
vswprintf.c 2013-11-26 Julio Gutierrez <jgutleyva@gmail.com> 2013-11-26 17:21:01 +00:00
vswscanf.c 2013-11-26 Julio Gutierrez <jgutleyva@gmail.com> 2013-11-26 17:21:01 +00:00
vwprintf.c 2013-11-26 Julio Gutierrez <jgutleyva@gmail.com> 2013-11-26 17:21:01 +00:00
vwscanf.c 2013-11-26 Julio Gutierrez <jgutleyva@gmail.com> 2013-11-26 17:21:01 +00:00
wbuf.c printf: set errno for read-only stream 2011-06-14 03:56:05 +00:00
wprintf.c 2013-11-26 Julio Gutierrez <jgutleyva@gmail.com> 2013-11-26 17:21:01 +00:00
wscanf.c 2013-11-26 Julio Gutierrez <jgutleyva@gmail.com> 2013-11-26 17:21:01 +00:00
wsetup.c printf: set errno for read-only stream 2011-06-14 03:56:05 +00:00