Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Tue, 13 Mar 2012 11:05:31 -0400
From: Rich Felker <>
Subject: Re: scanf %x bug

On Tue, Mar 13, 2012 at 02:51:18PM +0100, Szabolcs Nagy wrote:
> i found a scanf bug:
> #include <stdio.h>
> int main(){
>     int n, a=7;
>     n = sscanf("0", "%x", &a);
>     printf("%d %d\n", n, a);
>     return 0;
> }
> prints 0 7
> instead of 1 0

Bleh, musl's scanf is really bad but I don't feel like rewriting it...
Maybe I'll see if I can do that at the same time I replace the strtod
code (which scanf will need to use). In the mean time I'll see if
there's a fix for this specific issue. Have you found the corner case
that triggers it?


Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.