Hi Branden, Re: Branden Robinson 2007-03-29 <[EMAIL PROTECTED]> > 224 -rw------- 1 branden branden -1278424206 Mar 28 18:10 zpam > > Obviously, a negative file size is nonsensical.
Confirmed (on i386, works on amd64).
> Someone is probably using a signed int when they should be using an
> unsigned one.
>
> And should probably be using a 64-bit type, anyway, for future proofing.
> If a mailbox can exceed 2GB in size, it can exceed 4GB.
The code is in browser.c:
case 's':
if (folder->ff->st != NULL)
{
snprintf (tmp, sizeof (tmp), "%%%sld", fmt);
snprintf (dest, destlen, tmp, (long) folder->ff->st->st_size);
}
st is a struct stat, i.e. st_size is an off_t. config.h defines
_FILE_OFFSET_BITS 64.
I just tried using %lld, but it gives bad results:
32 -rw-rw-r-- 1 cb cb 490331304449 Mar 29 12:37 foo
33 -rwxrwxr-x 1 cb cb 489626272347 Mar 23 00:32 gnatscia.pl*
34 -rw------- 1 cb cb 489652736918 Nov 07 2004 hgtg.mp3
-rw-rw-r-- 1 cb cb 5000000001 2007-03-29 12:37 foo
-rwxrwxr-x 1 cb cb 603 2007-03-23 00:32 gnatscia.pl*
-rw------- 1 cb cb 26465174 2004-11-07 02:07 hgtg.mp3
http://mail-index.netbsd.org/tech-misc/2003/01/20/0002.html suggests
using PRId64 but that gives the same result.
Christoph
--
[EMAIL PROTECTED] | http://www.df7cb.de/
signature.asc
Description: Digital signature

