applied coding convention and changed error printout to DEBUG(...)

This commit is contained in:
Martin 2013-09-24 07:35:50 +02:00
parent a6d86fc7f9
commit f7c41cfe8e

View File

@ -780,15 +780,14 @@ void lowpan_read(uint8_t *data, uint8_t length, ieee_802154_long_t *s_laddr,
else { else {
lowpan_reas_buf_t *current_buf = get_packet_frag_buf(length, 0, s_laddr, lowpan_reas_buf_t *current_buf = get_packet_frag_buf(length, 0, s_laddr,
d_laddr); d_laddr);
if(current_buf != NULL) if (current_buf && current_buf->packet) {
{
/* Copy packet bytes into corresponding packet space area */ /* Copy packet bytes into corresponding packet space area */
memcpy(current_buf->packet, data, length); memcpy(current_buf->packet, data, length);
current_buf->current_packet_size += length; current_buf->current_packet_size += length;
add_fifo_packet(current_buf); add_fifo_packet(current_buf);
}else }
{ else {
printf("ERROR: no memory left in packet buffer!\n"); DEBUG("ERROR: no memory left in packet buffer!\n");
} }
if (thread_getstatus(transfer_pid) == STATUS_SLEEPING) { if (thread_getstatus(transfer_pid) == STATUS_SLEEPING) {
thread_wakeup(transfer_pid); thread_wakeup(transfer_pid);