[PATCH] md5.c: fix a typo in the size argument of memset

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

[PATCH] md5.c: fix a typo in the size argument of memset

Michal Terepeta
Hi,

Apparently GCC 4.8 has some new warnings that caught a typo in a memset
call in libraries/base/cbits/md5.c.  Patch attached.

Cheers,
Michal

Reply | Threaded
Open this post in threaded view
|

[PATCH] md5.c: fix a typo in the size argument of memset

Edward Z. Yang
Pushed, thanks.

Edward

Excerpts from Michal Terepeta's message of Tue Apr 16 08:25:01 -0700 2013:

> Hi,
>
> Apparently GCC 4.8 has some new warnings that caught a typo in a memset
> call in libraries/base/cbits/md5.c.  Patch attached.
>
> Cheers,
> Michal
> From c473c49db055c4e53d318c595666f22ac2c4ef97 Mon Sep 17 00:00:00 2001
> From: Michal Terepeta <michal.terepeta at gmail.com>
> Date: Tue, 16 Apr 2013 09:15:36 +0200
> Subject: [PATCH] md5.c: fix a typo in the size argument of memset
>
> ---
>  cbits/md5.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/cbits/md5.c b/cbits/md5.c
> index 0570cbb..c928316 100644
> --- a/cbits/md5.c
> +++ b/cbits/md5.c
> @@ -130,7 +130,7 @@ MD5Final(byte digest[16], struct MD5Context *ctx)
>  
>          byteSwap(ctx->buf, 4);
>          memcpy(digest, ctx->buf, 16);
> -        memset(ctx,0,sizeof(ctx));
> +        memset(ctx, 0, sizeof(*ctx));
>  }
>  
>  
> --
> 1.8.2.1