From 66d6aece65a7517f77c396576938c8224eae8b52 Mon Sep 17 00:00:00 2001 From: Benjamin Valentin Date: Wed, 23 Oct 2024 14:41:45 +0200 Subject: [PATCH] nanocoap_sock: output diagnostic response when DEBUG is enabled --- sys/net/application_layer/nanocoap/sock.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sys/net/application_layer/nanocoap/sock.c b/sys/net/application_layer/nanocoap/sock.c index 0b8343523e..5f5f48bf75 100644 --- a/sys/net/application_layer/nanocoap/sock.c +++ b/sys/net/application_layer/nanocoap/sock.c @@ -615,6 +615,8 @@ static int _block_cb(void *arg, coap_pkt_t *pkt) int res = _get_error(pkt); if (res) { + pkt->payload[pkt->payload_len] = 0; + DEBUG("nanocoap: %u '%s'\n", coap_get_code_decimal(pkt), (char *)pkt->payload); return res; }