summaryrefslogtreecommitdiff
path: root/stdio-common/tstscanf.c
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2000-05-22 16:41:59 +0000
committerUlrich Drepper <drepper@redhat.com>2000-05-22 16:41:59 +0000
commit3f651a4de302da8fbe4fb5f6e34f658bf11a8a7c (patch)
treebcde2754d2b573fd268bb9b047e9d9ce32eadd49 /stdio-common/tstscanf.c
parent6aa29abe9fab81e153d6232edf4ba048ac7d0b6e (diff)
Update.
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.
Diffstat (limited to 'stdio-common/tstscanf.c')
-rw-r--r--stdio-common/tstscanf.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/stdio-common/tstscanf.c b/stdio-common/tstscanf.c
index 93f77ce2d9..6db98eef31 100644
--- a/stdio-common/tstscanf.c
+++ b/stdio-common/tstscanf.c
@@ -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)
{