<<< Date Index >>>     <<< Thread Index >>>

Re: [PATCH] printf size_t in imap_append_message



On Sun, Nov 07, 2004 at 05:59:07PM +0100, Ralf Wildenhues wrote:
> Hi there,
> 
> there's a size_t in imap_append_message not printed out portably.
> The patch below fixes that, against CVS HEAD.
> 
> Regards,
> Ralf
> 
> Index: imap/message.c
> ===================================================================
> RCS file: /home/roessler/cvs/mutt/imap/message.c,v
> retrieving revision 3.10
> diff -u -r3.10 message.c
> --- imap/message.c    30 Oct 2004 21:59:00 -0000      3.10
> +++ imap/message.c    7 Nov 2004 16:50:40 -0000
> @@ -439,7 +439,7 @@
>    rewind (fp);
>    
>    imap_munge_mbox_name (mbox, sizeof (mbox), mailbox);
> -  snprintf (buf, sizeof (buf), "APPEND %s (\\Seen) {%d}", mbox, len);
> +  snprintf (buf, sizeof (buf), "APPEND %s (\\Seen) {%lu}", mbox, (unsigned 
> long)len);

For maximum portability (and skipping a typecast), shouldn't that be
%zu if len is a size_t?  I seem to recall that the 'z' flag is in
POSIX.

David