From 16f8d4ebf0fd4847fa83d9c61f4150273cb4f533 Mon Sep 17 00:00:00 2001 From: Rich Salz Date: Mon, 4 May 2015 18:00:15 -0400 Subject: memset, memcpy, sizeof consistency fixes Just as with the OPENSSL_malloc calls, consistently use sizeof(*ptr) for memset and memcpy. Remove needless casts for those functions. For memset, replace alternative forms of zero with 0. Reviewed-by: Richard Levitte --- crypto/md2/md2_dgst.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'crypto/md2') diff --git a/crypto/md2/md2_dgst.c b/crypto/md2/md2_dgst.c index e206b3fba6..70c19fba31 100644 --- a/crypto/md2/md2_dgst.c +++ b/crypto/md2/md2_dgst.c @@ -122,9 +122,9 @@ const char *MD2_options(void) int MD2_Init(MD2_CTX *c) { c->num = 0; - memset(c->state, 0, sizeof c->state); - memset(c->cksm, 0, sizeof c->cksm); - memset(c->data, 0, sizeof c->data); + memset(c->state, 0, sizeof(c->state)); + memset(c->cksm, 0, sizeof(c->cksm)); + memset(c->data, 0, sizeof(c->data)); return 1; } @@ -219,6 +219,6 @@ int MD2_Final(unsigned char *md, MD2_CTX *c) for (i = 0; i < 16; i++) md[i] = (UCHAR) (p1[i] & 0xff); - memset((char *)&c, 0, sizeof(c)); + memset(&c, 0, sizeof(c)); return 1; } -- cgit v1.2.1