diff options
author | Uros Majstorovic <majstor@majstor.org> | 2018-03-15 18:35:01 +0100 |
---|---|---|
committer | Uros Majstorovic <majstor@majstor.org> | 2018-03-15 18:35:01 +0100 |
commit | 6d38cd1c2f6075d36da2a2a8112af4593bc846f4 (patch) | |
tree | 03d2e07f74bd362d17321a6153f9f81a35af2032 /code/fe310/eos/ecp.c | |
parent | 2e711a0a5cbaeec7d3d5a742f8d536311d5d9677 (diff) |
fixed debug print
Diffstat (limited to 'code/fe310/eos/ecp.c')
-rw-r--r-- | code/fe310/eos/ecp.c | 10 |
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); } |