]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
Update.
authorUlrich Drepper <drepper@redhat.com>
Mon, 22 May 2000 16:41:59 +0000 (16:41 +0000)
committerUlrich Drepper <drepper@redhat.com>
Mon, 22 May 2000 16:41:59 +0000 (16:41 +0000)
2000-05-22  Jakub Jelinek <jakub@redhat.com>

* stdio-common/vfscanf.c (__vfscanf): Remove bogus check if '-' is
not the second character in the range.
* stdio-common/tstscanf.c (main): Add testcase for the above.
Reported by jik@kamens.brookline.ma.us.

ChangeLog
stdio-common/tstscanf.c
stdio-common/vfscanf.c

index 95651bbfa4d3a1abcae4fe8c31a3dd51fc50c19e..962c9b23e5d456c11bec28f05a78c889e2f84576 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2000-05-22  Jakub Jelinek <jakub@redhat.com>
+
+       * stdio-common/vfscanf.c (__vfscanf): Remove bogus check if '-' is
+       not the second character in the range.
+       * stdio-common/tstscanf.c (main): Add testcase for the above.
+       Reported by jik@kamens.brookline.ma.us.
+
 2000-05-21  H.J. Lu  <hjl@gnu.org>
 
        * elf/do-lookup.h (do_lookup_versioned): Replace reloc_type parameter
index 93f77ce2d904cfa60c3d31b0b1a7bdcc3254f806..6db98eef318a016e464699845322784f8e49ea84 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991, 92, 96, 97, 98, 99 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 92, 96, 97, 98, 99, 2000 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
@@ -39,6 +39,13 @@ main (int argc, char **argv)
       result = 1;
     }
 
+  if (sscanf ("08905x", "%9[0-9]", buf) != 1
+      || strcmp (buf, "08905") != 0)
+    {
+      fputs ("test failed!\n", stdout);
+      result = 1;
+    }
+
   sscanf ("conversion] Zero flag Ze]ro#\n", "%*[^]] %[^#]\n", buf);
   if (strcmp (buf, "] Zero flag Ze]ro") != 0)
     {
index 0412ca66eb97c80e97f1bcd88c6631462cc36f5d..3ca82cc4c7c36b60a12a89d72840644e73644211 100644 (file)
@@ -1657,9 +1657,8 @@ __vfscanf (FILE *s, const char *format, va_list argptr)
              ++f;
            }
 
-         tw = (char *) f;
          while ((fc = *f++) != '\0' && fc != ']')
-           if (fc == '-' && *f != '\0' && *f != ']' && f - 2 != tw
+           if (fc == '-' && *f != '\0' && *f != ']'
                && (unsigned char) f[-2] <= (unsigned char) *f)
              {
                /* Add all characters from the one before the '-'