public inbox for newlib-cvs@sourceware.org
help / color / mirror / Atom feed
* [newlib-cygwin] newlib: vfwscanf: fix miscomputation of max field width in %[] case
@ 2017-11-30 20:02 Corinna Vinschen
  0 siblings, 0 replies; only message in thread
From: Corinna Vinschen @ 2017-11-30 20:02 UTC (permalink / raw)
  To: newlib-cvs

https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=71616225144e61c0a951a1353aea77e524849976

commit 71616225144e61c0a951a1353aea77e524849976
Author: Corinna Vinschen <corinna@vinschen.de>
Date:   Thu Nov 30 21:02:38 2017 +0100

    newlib: vfwscanf: fix miscomputation of max field width in %[] case
    
    Signed-off-by: Corinna Vinschen <corinna@vinschen.de>

Diff:
---
 newlib/libc/stdio/vfwscanf.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/newlib/libc/stdio/vfwscanf.c b/newlib/libc/stdio/vfwscanf.c
index 54bbb09..27b70fb 100644
--- a/newlib/libc/stdio/vfwscanf.c
+++ b/newlib/libc/stdio/vfwscanf.c
@@ -879,7 +879,7 @@ _DEFUN(__SVFWSCANF_R, (rptr, fp, fmt0, ap),
 	      n = 0;
 	      memset ((_PTR) &mbs, '\0', sizeof (mbstate_t));
 	      while ((wi = _fgetwc_r (rptr, fp)) != WEOF
-		     && width-- != 0 && INCCL (wi))
+		     && width != 0 && INCCL (wi))
 		{
 		  if (width >= MB_CUR_MAX && !(flags & SUPPRESS))
 		    {


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2017-11-30 20:02 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-11-30 20:02 [newlib-cygwin] newlib: vfwscanf: fix miscomputation of max field width in %[] case Corinna Vinschen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).