summary refs log tree commit diff
path: root/stdio-common/tstscanf.c
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2000-07-22 07:26:13 +0000
committerUlrich Drepper <drepper@redhat.com>2000-07-22 07:26:13 +0000
commitfcc10ffab6d696cdda8a1a33b8e1720d90f7a15b (patch)
treeaae8d3effebc9e4e1428c1cedafc35666ebcb62c /stdio-common/tstscanf.c
parent40c014b3dcc698ae2cc935aefabbeb2196088128 (diff)
downloadglibc-fcc10ffab6d696cdda8a1a33b8e1720d90f7a15b.tar.gz
glibc-fcc10ffab6d696cdda8a1a33b8e1720d90f7a15b.tar.xz
glibc-fcc10ffab6d696cdda8a1a33b8e1720d90f7a15b.zip
Update.
	* stdio-common/vfscanf.c: Handle input -- with format %f correctly
	(it's no input error).
	* stdio-common/tstscanf.c: Add test case for format %f with input --.
	* stdio-common/scanf12.c: Correct expected result for first scanf.
Diffstat (limited to 'stdio-common/tstscanf.c')
-rw-r--r--stdio-common/tstscanf.c17
1 files changed, 15 insertions, 2 deletions
diff --git a/stdio-common/tstscanf.c b/stdio-common/tstscanf.c
index 6db98eef31..4732657e53 100644
--- a/stdio-common/tstscanf.c
+++ b/stdio-common/tstscanf.c
@@ -277,7 +277,7 @@ main (int argc, char **argv)
     /* From PR libc/1313 reported by Ben Caradoc-Davies <bmcd@physics.otago.ac.nz>.  */
     float value;
     int res;
-    
+
     res = sscanf ("0123", "%2f", &value);
     if (res != 1 || value != 1.0)
       {
@@ -285,6 +285,19 @@ main (int argc, char **argv)
 	result = 1;
       }
   }
-  
+
+  fputs ("Test 10:\n", stdout);
+  {
+    float value;
+    int res;
+
+    res = sscanf ("--", "%f", &value);
+    if (res != 0)
+      {
+	fputs ("test failed!\n", stdout);
+	result = 1;
+      }
+  }
+
   exit (result);
 }