about summary refs log tree commit diff
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2005-04-26 20:52:22 +0000
committerUlrich Drepper <drepper@redhat.com>2005-04-26 20:52:22 +0000
commit946c5771677ce94c73a0c48f6e9f10c7e0ee3f43 (patch)
tree2fed1e24a994d7f6429692a61889e65d66b5c60a
parentbdd075fe25a77dc7d3b106e5d84c2cd7e84476d0 (diff)
downloadglibc-946c5771677ce94c73a0c48f6e9f10c7e0ee3f43.tar.gz
glibc-946c5771677ce94c73a0c48f6e9f10c7e0ee3f43.tar.xz
glibc-946c5771677ce94c73a0c48f6e9f10c7e0ee3f43.zip
Correctly account for characters of decimal points right after +-.
-rw-r--r--stdio-common/vfscanf.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/stdio-common/vfscanf.c b/stdio-common/vfscanf.c
index 4434fa6d7b..be008dc687 100644
--- a/stdio-common/vfscanf.c
+++ b/stdio-common/vfscanf.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2002, 2003, 2004 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2002, 2003, 2004, 2005 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -1631,14 +1631,13 @@ _IO_vfscanf (s, format, argptr, errp)
 		  const char *cmpp = decimal;
 		  int avail = width > 0 ? width : INT_MAX;
 
-		  while ((unsigned char) *cmpp == c && avail > 0)
+		  while ((unsigned char) *cmpp == c && avail-- > 0)
 		    if (*++cmpp == '\0')
 		      break;
 		    else
 		      {
 			if (inchar () == EOF)
 			  break;
-			--avail;
 		      }
 
 		  if (*cmpp != '\0')