[Toybox] [landley/toybox] Toybox printf is printing incorrect hex values (#54)

Rob Landley rob at landley.net
Fri Nov 18 13:19:35 PST 2016


On 11/17/2016 09:39 PM, Sandeep Kumar wrote:
> I am working in android environment.
> printf of an hex value is print string values. Please see the below code
> 
> |root:/ # printf "%x\n" 100 300000078 |
> 
> 64 is expected but it prints strange values.

I'm getting 64 here... ah, that's what I'm getting with 64-bit glibc.
With 32-bit musl I get:

$ ./printf '%x\n' 100
80539a100000064

Which is very much not right. Hmmm... Ah! printf("%llx", (long)blah);

Fixed. Sorry about that,

Rob




More information about the Toybox mailing list