summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2007-07-12 15:13:47 +0000
committerJakub Jelinek <jakub@redhat.com>2007-07-12 15:13:47 +0000
commite010bc493e9677320f313dcf4ebdb714b823d524 (patch)
tree54d399198cf595a3395809f119abea8aaeec5a82
parent843c2a7ac5f04ba481706a5304b8c7d6d96a6461 (diff)
downloadglibc-e010bc493e9677320f313dcf4ebdb714b823d524.tar
glibc-e010bc493e9677320f313dcf4ebdb714b823d524.tar.gz
glibc-e010bc493e9677320f313dcf4ebdb714b823d524.tar.bz2
glibc-e010bc493e9677320f313dcf4ebdb714b823d524.zip
2007-04-27 Ulrich Drepper <drepper@redhat.com>
[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.
-rw-r--r--ChangeLog7
-rw-r--r--stdio-common/tstscanf.c2
-rw-r--r--stdio-common/vfscanf.c5
3 files changed, 10 insertions, 4 deletions
diff --git a/ChangeLog b/ChangeLog
index e5c57854a1..8ae7d29660 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,12 @@
2007-04-27 Ulrich Drepper <drepper@redhat.com>
+ [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 <drepper@redhat.com>
+
[BZ #3213]
* locale/C-translit.h.in: Add entry for U2044.
diff --git a/stdio-common/tstscanf.c b/stdio-common/tstscanf.c
index 44ddf49e15..e8ca17be79 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 1ea9bc4e07..a1e92768f4 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: