This is the mail archive of the
glibc-bugs@sources.redhat.com
mailing list for the glibc project.
[Bug libc/216] New: scanf() conversion %i incorrectly reads unsigned hex values
- From: "relf at os2 dot ru" <sourceware-bugzilla at sources dot redhat dot com>
- To: glibc-bugs at sources dot redhat dot com
- Date: 11 Jun 2004 07:47:32 -0000
- Subject: [Bug libc/216] New: scanf() conversion %i incorrectly reads unsigned hex values
- Reply-to: sourceware-bugzilla at sources dot redhat dot com
The following program reads 0xF1234567 as 0x7fffffff:
#include <stdio.h>
int main() {
char* s = "0xF1234567";
unsigned int x;
sscanf(s,"%i",&x);
printf("Got: 0x%08x\n",x);
return 0;
}
--
Summary: scanf() conversion %i incorrectly reads unsigned hex
values
Product: glibc
Version: 2.3.2
Status: NEW
Severity: normal
Priority: P2
Component: libc
AssignedTo: gotom at debian dot or dot jp
ReportedBy: relf at os2 dot ru
CC: glibc-bugs at sources dot redhat dot com
http://sources.redhat.com/bugzilla/show_bug.cgi?id=216
------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.