From 43c30eec5196fa8ace45cc703fffe38c69563220 Mon Sep 17 00:00:00 2001 From: Uros Majstorovic Date: Thu, 3 Aug 2017 00:23:31 +0200 Subject: fixed rbuf init --- code/core/rbuf.c | 1 + code/core/rbuf_recv.c | 1 - code/core/rbuf_send.c | 1 - 3 files changed, 1 insertion(+), 2 deletions(-) (limited to 'code') diff --git a/code/core/rbuf.c b/code/core/rbuf.c index d6c9c6e..0865e67 100644 --- a/code/core/rbuf.c +++ b/code/core/rbuf.c @@ -3,6 +3,7 @@ #include int ecp_rbuf_init(ECPRBuffer *rbuf, ECPRBMessage *msg, unsigned int msg_size) { + memset(msg, 0, sizeof(ECPRBMessage) * msg_size); rbuf->msg = msg; if (msg_size) { rbuf->msg_size = msg_size; diff --git a/code/core/rbuf_recv.c b/code/core/rbuf_recv.c index 6a46a00..222daa7 100644 --- a/code/core/rbuf_recv.c +++ b/code/core/rbuf_recv.c @@ -75,7 +75,6 @@ static int ack_shift(ECPRBRecv *buf) { int ecp_rbuf_recv_create(ECPRBRecv *buf, ECPRBMessage *msg, unsigned int msg_size) { memset(buf, 0, sizeof(ECPRBRecv)); - memset(msg, 0, sizeof(ECPRBMessage) * msg_size); ecp_rbuf_init(&buf->rbuf, msg, msg_size); buf->ack_map = ECP_RBUF_ACK_FULL; buf->ack_rate = ACK_RATE; diff --git a/code/core/rbuf_send.c b/code/core/rbuf_send.c index 7ae5aca..5f3bc87 100644 --- a/code/core/rbuf_send.c +++ b/code/core/rbuf_send.c @@ -57,7 +57,6 @@ static ssize_t handle_ack(ECPConnection *conn, ecp_seq_t seq, unsigned char mtyp int ecp_rbuf_send_create(ECPRBSend *buf, ECPRBMessage *msg, unsigned int msg_size) { memset(buf, 0, sizeof(ECPRBRecv)); - memset(msg, 0, sizeof(ECPRBMessage) * msg_size); ecp_rbuf_init(&buf->rbuf, msg, msg_size); return ECP_OK; -- cgit v1.2.3