newlib: vfwscanf: fix miscomputation of max field width in %[] case
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
This commit is contained in:
parent
b9a662bb4c
commit
7161622514
|
@ -879,7 +879,7 @@ _DEFUN(__SVFWSCANF_R, (rptr, fp, fmt0, ap),
|
||||||
n = 0;
|
n = 0;
|
||||||
memset ((_PTR) &mbs, '\0', sizeof (mbstate_t));
|
memset ((_PTR) &mbs, '\0', sizeof (mbstate_t));
|
||||||
while ((wi = _fgetwc_r (rptr, fp)) != WEOF
|
while ((wi = _fgetwc_r (rptr, fp)) != WEOF
|
||||||
&& width-- != 0 && INCCL (wi))
|
&& width != 0 && INCCL (wi))
|
||||||
{
|
{
|
||||||
if (width >= MB_CUR_MAX && !(flags & SUPPRESS))
|
if (width >= MB_CUR_MAX && !(flags & SUPPRESS))
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue