From e010bc493e9677320f313dcf4ebdb714b823d524 Mon Sep 17 00:00:00 2001 From: Jakub Jelinek Date: Thu, 12 Jul 2007 15:13:47 +0000 Subject: [PATCH] 2007-04-27 Ulrich Drepper [BZ #4342] * stdio-common/vfscanf.c (_IO_vfscanf_internal): Allow hexa-decimal floats without exponent. * stdio-common/tstscanf.c (main): Adjust Test 8 test for success. --- ChangeLog | 7 +++++++ stdio-common/tstscanf.c | 2 +- stdio-common/vfscanf.c | 5 ++--- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index e5c57854a14..8ae7d29660b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2007-04-27 Ulrich Drepper + + [BZ #4342] + * stdio-common/vfscanf.c (_IO_vfscanf_internal): Allow + hexa-decimal floats without exponent. + * stdio-common/tstscanf.c (main): Adjust Test 8 test for success. + 2007-04-27 Ulrich Drepper [BZ #3213] diff --git a/stdio-common/tstscanf.c b/stdio-common/tstscanf.c index 44ddf49e15a..e8ca17be79e 100644 --- a/stdio-common/tstscanf.c +++ b/stdio-common/tstscanf.c @@ -272,7 +272,7 @@ main (int argc, char **argv) res = sscanf ("0x1234", "%lf", &d); printf ("res = %d, d = %f\n", res, d); - if (res != 0 || d != 123456.789) + if (res != 1 || d != 4660) { fputs ("test failed!\n", stdout); result = 1; diff --git a/stdio-common/vfscanf.c b/stdio-common/vfscanf.c index 1ea9bc4e07d..a1e92768f4f 100644 --- a/stdio-common/vfscanf.c +++ b/stdio-common/vfscanf.c @@ -1888,9 +1888,8 @@ _IO_vfscanf_internal (_IO_FILE *s, const char *format, _IO_va_list argptr, /* Have we read any character? If we try to read a number in hexadecimal notation and we have read only the `0x' - prefix or no exponent this is an error. */ - if (__builtin_expect (wpsize == 0 - || (is_hexa && (wpsize == 2 || ! got_e)), 0)) + prefix this is an error. */ + if (__builtin_expect (wpsize == 0 || (is_hexa && wpsize == 2), 0)) conv_error (); scan_float: -- 2.47.2