autoconf
[Top][All Lists]
Advanced

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

Re: Question regarding sscanf() vs. off_t and similar


From: Philipp Marek
Subject: Re: Question regarding sscanf() vs. off_t and similar
Date: Thu, 14 Sep 2006 16:41:30 +0200
User-agent: KMail/1.9.3

On Thursday 14 September 2006 14:49 Eric Blake wrote:
> According to Philipp Marek on 9/13/2006 1:05 PM:
> > If I'm doing
> >     ino_t ino;
> >     char *name;
> >     sprintf("%Lu %s", ino, name);
> > that works fine for 64bit systems, but writes trash for sizeof(ino_t) ==
> > 4.
>
> Gnulib provides umaxtostr.c, which is a convenient way of printing any
> integer of unknown width:
>
> char buf[INT_BUFSIZE_BOUND (uintmax_t)];
> sprintf("%s %s", umaxtostr(ino, buf), name);
But then I'd need a few of these buffers in a sprintf() call with 15 
arguments, and if umaxtostr() is not available on solaris etc. I can't use 
it ...

But that's an idea - writing my own umaxtostr() function. Maybe that's an 
idea.

Or I cast everything to an (long long) type ... then it should work, too.


Thank you for this answer!


Regards,

Phil

-- 
Versioning your /etc, /home or even your whole installation?
             Try fsvs (fsvs.tigris.org)!




reply via email to

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