Code Monkey home page Code Monkey logo

Comments (4)

landley avatar landley commented on July 22, 2024 1

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

from toybox.

sandeepmvd avatar sandeepmvd commented on July 22, 2024 1

Thank you for the fix.
I am cherry-picking this patch - 46ae1aa
Thank you.

from toybox.

sandeepmvd avatar sandeepmvd commented on July 22, 2024 1

I have confirmed it. This patch fixes the issue

root:/ # printf "%x\n" 100                                          
64

Thank you once again.

from toybox.

enh avatar enh commented on July 22, 2024

sandeep: mark as closed?

from toybox.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.