diff options
author | Rich Salz <rsalz@akamai.com> | 2015-05-04 18:00:15 -0400 |
---|---|---|
committer | Rich Salz <rsalz@openssl.org> | 2015-05-05 22:18:59 -0400 |
commit | 16f8d4ebf0fd4847fa83d9c61f4150273cb4f533 (patch) | |
tree | 3c30094cad38433c24008c30efe3d93cf38d8ae9 /crypto/md2 | |
parent | 12048657a91b12e499d03ec9ff406b42aba67366 (diff) |
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 <levitte@openssl.org>
Diffstat (limited to 'crypto/md2')
-rw-r--r-- | crypto/md2/md2_dgst.c | 8 |
1 files changed, 4 insertions, 4 deletions
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; } |