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

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

 



-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

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);

- --
Life is short - so eat dessert first!

Eric Blake             ebb9@xxxxxxx
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2.1 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFFCU/s84KuGfSFAYARAuuQAJsHZq22FdhHbfrOtsL1/rWx0ihelQCeIDre
hXNjTDgGGkMyCbYjXR1b4a8=
=6u8G
-----END PGP SIGNATURE-----


_______________________________________________
Autoconf mailing list
Autoconf@xxxxxxx
http://lists.gnu.org/mailman/listinfo/autoconf

[Index of Archives]     [GCC Help]     [Kernel Discussion]     [RPM Discussion]     [Red Hat Development]     [Yosemite News]     [Linux USB]     [Samba]

  Powered by Linux