mirror of
https://github.com/obgm/libcoap.git
synced 2026-11-23 15:41:04 +03:00
fixed off-by-one bug in show_data
This commit is contained in:
1 parent
3161470b71
commit
18ef43790e
1 file changed
+1
-1
@@ -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);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user