From a529b416204403526663696b3dd9fbd567937b9b Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Tue, 7 Aug 2001 04:37:18 +0000 Subject: Update. 2001-08-06 Jakub Jelinek * stdlib/strtod.c (STRTOF): Skip whole infinity, not just inf. * stdio-common/vfscanf.c (__vfscanf): +- can be followed by i in +-Inf. * stdlib/tst-strtod.c (tests): Add Inf tests. * stdio-common/tstscanf.c (main): Add tests for +- before Inf. * locale/weightwc.h (findidx): Change type of i to int32_t. --- stdio-common/tstscanf.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'stdio-common/tstscanf.c') diff --git a/stdio-common/tstscanf.c b/stdio-common/tstscanf.c index dc02acc4a1..44ddf49e15 100644 --- a/stdio-common/tstscanf.c +++ b/stdio-common/tstscanf.c @@ -21,6 +21,7 @@ #else #include #endif +#include #include #include @@ -331,6 +332,25 @@ main (int argc, char **argv) } } + fputs ("Test 13:\n", stdout); + { + float value; + int res; + + res = sscanf ("-InF", "%f", &value); + if (res != 1 || isinf (value) != -1) + { + fputs ("test failed!\n", stdout); + result = 1; + } + + res = sscanf ("+InfiNiTY", "%f", &value); + if (res != 1 || isinf (value) != 1) + { + fputs ("test failed!\n", stdout); + result = 1; + } + } return result; } -- cgit v1.2.3