Re: [PATCH 10/15] imap-send.c: rearrange xcalloc arguments

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

 



Brian,

On Tue, May 27, 2014 at 12:33:51AM +0900, Brian Gesiak wrote:
> xcalloc takes two arguments: the number of elements and their size.
> imap_open_store passes the arguments in reverse order, passing the
> size of an imap_store*, followed by the number to allocate.
> Rearrgange them so they are in the correct order.
> 
> Signed-off-by: Brian Gesiak <modocache@xxxxxxxxx>
> ---
>  imap-send.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/imap-send.c b/imap-send.c
> index 0bc6f7f..45230e1 100644
> --- a/imap-send.c
> +++ b/imap-send.c
> @@ -951,7 +951,7 @@ static struct imap_store *imap_open_store(struct imap_server_conf *srvc)
>  	char *arg, *rsp;
>  	int s = -1, preauth;
>  
> -	ctx = xcalloc(sizeof(*ctx), 1);
> +	ctx = xcalloc(1, sizeof(*ctx));
>  
>  	ctx->imap = imap = xcalloc(sizeof(*imap), 1);
                       ^^^^^^^^^^^^^^^^^^^^^^^^

Why wasn't the second instance swapped?  It is still this way in the
latest 'pu' branch.

-- 
Jeremiah Mahler
jmmahler@xxxxxxxxx
http://github.com/jmahler
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]