Date: 17 Sep 1995 11:47:32 +0800 From: peter@haywire.dialix.com (Peter Wemm) To: freebsd-hackers@freebsd.org Subject: Re: 64 bit off_t and varargs/printf Message-ID: <43g5ok$del$1@haywire.DIALix.COM> References: <199509170122.SAA12369@cory.EECS.Berkeley.EDU>, <199509170220.EAA01650@keltia.Freenix.FR>
next in thread | previous in thread | raw e-mail | index | archive | help
roberto@keltia.Freenix.FR (Ollivier Robert) writes:
>It seems that Josh MacDonald said:
>> char num[10];
>> num = "1234"
>> off_t size;
>> size = strtoq(num, &num, 10);
>> printf("%d\n", size);
>>
>> is causing it troubles. Replacing the off_t type with a long fixes
>> things. Anyone know what might be happening?
>Yes, you have the same bug as did wu-ftpd. Put %qd instead of %d in the
>printf format string to fix it. "%d" == int (32 bits), "%qd" is quad (64
>bits).
We already have a working "port" of this.. ports/net/rdist6..
-Peter
>--
>Ollivier ROBERT -=- The daemon is FREE! -=- roberto@keltia.frmug.fr.net
> FreeBSD keltia.Freenix.FR 2.2-CURRENT #1: Sun Sep 10 18:50:19 MET DST 1995
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?43g5ok$del$1>
