summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUros Majstorovic <majstor@majstor.org>2018-03-15 18:35:01 +0100
committerUros Majstorovic <majstor@majstor.org>2018-03-15 18:35:01 +0100
commit6d38cd1c2f6075d36da2a2a8112af4593bc846f4 (patch)
tree03d2e07f74bd362d17321a6153f9f81a35af2032
parent2e711a0a5cbaeec7d3d5a742f8d536311d5d9677 (diff)
fixed debug print
-rw-r--r--code/fe310/eos/ecp.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/code/fe310/eos/ecp.c b/code/fe310/eos/ecp.c
index 9301555..61f834a 100644
--- a/code/fe310/eos/ecp.c
+++ b/code/fe310/eos/ecp.c
@@ -1,5 +1,6 @@
#include <stddef.h>
#include <string.h>
+#include <stdlib.h>
#include "encoding.h"
#include "platform.h"
@@ -40,7 +41,14 @@ static void packet_handler(unsigned char cmd, unsigned char *buffer, uint16_t le
memcpy(addr.host, buffer, sizeof(addr.host));
memcpy(&addr.port, buffer+sizeof(addr.host), sizeof(addr.port));
ssize_t rv = ecp_pkt_handle(_sock, &addr, NULL, &bufs, len-addr_len);
- if (rv < 0) DPRINT(rv, "ERR:packet_handler - RV:%d\n", rv);
+#ifdef ECP_DEBUG
+ if (rv < 0) {
+ char b[16];
+ puts("ERR:");
+ puts(itoa(rv, b, 10));
+ puts("\n");
+ }
+#endif
if (bufs.packet->buffer) eos_net_free(buffer, 0);
eos_net_release(0);
}