diff --git a/src/coap_debug.c b/src/coap_debug.c index 109c0a76..39731ad9 100644 --- a/src/coap_debug.c +++ b/src/coap_debug.c @@ -291,7 +291,7 @@ msg_code_string(uint16_t c) { } else if (c >= 224 && c - 224 < (int)(sizeof(signals)/sizeof(const char *))) { return signals[c-224]; } else { - snprintf(buf, sizeof(buf), "%u.%02u", c >> 5, c & 0x1f); + snprintf(buf, sizeof(buf), "%u.%02u", (c >> 5) & 0x7, c & 0x1f); return buf; } }