From 031b53872d574e508c781cfebad708958ce857b7 Mon Sep 17 00:00:00 2001 From: Ludwig Ortmann Date: Wed, 4 Sep 2013 20:40:58 +0200 Subject: [PATCH] initalize transceiver_buffer properly --- sys/transceiver/transceiver.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/transceiver/transceiver.c b/sys/transceiver/transceiver.c index 23bce42e6c..a93883f0cb 100644 --- a/sys/transceiver/transceiver.c +++ b/sys/transceiver/transceiver.c @@ -144,7 +144,7 @@ void transceiver_init(transceiver_type_t t) } /* Initializing transceiver buffer and data buffer */ - memset(transceiver_buffer, 0, TRANSCEIVER_BUFFER_SIZE); + memset(transceiver_buffer, 0, TRANSCEIVER_BUFFER_SIZE * sizeof(radio_packet_t)); memset(data_buffer, 0, TRANSCEIVER_BUFFER_SIZE * PAYLOAD_SIZE); for (i = 0; i < TRANSCEIVER_MAX_REGISTERED; i++) { @@ -529,7 +529,7 @@ void receive_nativenet_packet(radio_packet_t *trans_p) { DEBUG("Handling nativenet packet\n"); memcpy(trans_p, p, sizeof(radio_packet_t)); - memcpy((void*) &(data_buffer[transceiver_buffer_pos * PAYLOAD_SIZE]), p->data, p->length); + memcpy(&(data_buffer[transceiver_buffer_pos * PAYLOAD_SIZE]), p->data, p->length); trans_p->data = (uint8_t*) &(data_buffer[transceiver_buffer_pos * PAYLOAD_SIZE]); DEBUG("Packet %p was from %"PRIu16" to %"PRIu16", size: %"PRIu8"\n", trans_p, trans_p->src, trans_p->dst, trans_p->length);