This is the mail archive of the
glibc-bugs@sourceware.org
mailing list for the glibc project.
[Bug libc/4342] New: scanf %lg problem with hex numbers
- From: "madcoder at debian dot org" <sourceware-bugzilla at sourceware dot org>
- To: glibc-bugs at sources dot redhat dot com
- Date: 10 Apr 2007 21:22:10 -0000
- Subject: [Bug libc/4342] New: scanf %lg problem with hex numbers
- Reply-to: sourceware-bugzilla at sourceware dot org
scanf makes exponents specifiers mandatory whereas it should not. The code to
reproduce the problem is:
#include <stdio.h>
int
main (void)
{
double d = -999;
int ret;
ret = sscanf ("0x100", "%lg", &d);
printf ("%d %g\n", ret, d);
ret = sscanf ("0x100p0", "%lg", &d);
printf ("%d %g\n", ret, d);
return 0;
}
expected output would be:
1 256
1 256
it gives currently:
0 -999
1 256
--
Summary: scanf %lg problem with hex numbers
Product: glibc
Version: unspecified
Status: NEW
Severity: normal
Priority: P2
Component: libc
AssignedTo: drepper at redhat dot com
ReportedBy: madcoder at debian dot org
CC: glibc-bugs at sources dot redhat dot com
http://sourceware.org/bugzilla/show_bug.cgi?id=4342
------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.