bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] tests/test-vasprintf.c: Test %08lx.


From: Eric Blake
Subject: Re: [PATCH] tests/test-vasprintf.c: Test %08lx.
Date: Wed, 21 Apr 2010 08:08:32 -0600
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.9) Gecko/20100330 Fedora/3.0.4-1.fc12 Lightning/1.0b1 Thunderbird/3.0.4

On 04/21/2010 05:21 AM, Simon Josefsson wrote:
> For some reason 'asprintf (&tmp, "%08lx", 1)' yields '61fdec00003039'.
> I haven't started debugging the printf code yet, but will get to it...

Is this on a 32-bit or 64-bit platform?  It matters if you are asking to
print a 64-bit long, but passed a 32-bit int.  To be safe, you should be
using 1L or even 1UL to match the %lx.

-- 
Eric Blake   address@hidden    +1-801-349-2682
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]