Skip to content

Commit

Permalink
Correctly account for characters of decimal points right after +-.
Browse files Browse the repository at this point in the history
  • Loading branch information
Ulrich Drepper committed Apr 26, 2005
1 parent bdd075f commit 946c577
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions stdio-common/vfscanf.c
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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')
Expand Down

0 comments on commit 946c577

Please sign in to comment.