fixed off-by-one bug in show_data

This commit is contained in:
Olaf Bergmann committed 2010-07-08 17:08:50 +02:00
1 parent 3161470b71
commit 18ef43790e
1 file changed
+1 -1
+1 -1
View File
@@ -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);
}