From 18ef43790e527b3203672e8782290706141c2bfd Mon Sep 17 00:00:00 2001 From: Olaf Bergmann Date: Thu, 8 Jul 2010 17:08:50 +0200 Subject: [PATCH] fixed off-by-one bug in show_data --- net.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net.c b/net.c index 26f079ec..5b53eb8c 100644 --- a/net.c +++ b/net.c @@ -86,7 +86,7 @@ show( coap_opt_t *opt, unsigned char type, unsigned int len, const unsigned char void show_data( coap_pdu_t *pdu ) { static unsigned char buf[COAP_MAX_PDU_SIZE]; - unsigned int len = (int)( (unsigned char *)pdu->hdr + pdu->length - pdu->data ) + 1; + unsigned int len = (int)( (unsigned char *)pdu->hdr + pdu->length - pdu->data ); print_readable( pdu->data, len, buf, COAP_MAX_PDU_SIZE ); printf("'%s'", buf); }