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 /ssl/d1_both.c | |
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 'ssl/d1_both.c')
-rw-r--r-- | ssl/d1_both.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/ssl/d1_both.c b/ssl/d1_both.c index 65a3a18bc4..05b8f9e08a 100644 --- a/ssl/d1_both.c +++ b/ssl/d1_both.c @@ -467,7 +467,7 @@ long dtls1_get_message(SSL *s, int st1, int stn, int mt, long max, int *ok) } msg_hdr = &s->d1->r_msg_hdr; - memset(msg_hdr, 0x00, sizeof(struct hm_header_st)); + memset(msg_hdr, 0, sizeof(*msg_hdr)); again: i = dtls1_get_message_fragment(s, st1, stn, max, ok); @@ -497,7 +497,7 @@ long dtls1_get_message(SSL *s, int st1, int stn, int mt, long max, int *ok) s->msg_callback(0, s->version, SSL3_RT_HANDSHAKE, p, msg_len, s, s->msg_callback_arg); - memset(msg_hdr, 0x00, sizeof(struct hm_header_st)); + memset(msg_hdr, 0, sizeof(*msg_hdr)); /* Don't change sequence numbers while listening */ if (!s->d1->listen) @@ -1289,7 +1289,7 @@ unsigned int dtls1_min_mtu(SSL *s) void dtls1_get_message_header(unsigned char *data, struct hm_header_st *msg_hdr) { - memset(msg_hdr, 0x00, sizeof(struct hm_header_st)); + memset(msg_hdr, 0, sizeof(*msg_hdr)); msg_hdr->type = *(data++); n2l3(data, msg_hdr->msg_len); @@ -1300,7 +1300,7 @@ dtls1_get_message_header(unsigned char *data, struct hm_header_st *msg_hdr) void dtls1_get_ccs_header(unsigned char *data, struct ccs_header_st *ccs_hdr) { - memset(ccs_hdr, 0x00, sizeof(struct ccs_header_st)); + memset(ccs_hdr, 0, sizeof(*ccs_hdr)); ccs_hdr->type = *(data++); } |