coap_debug.c: Check value of COAP_DEBUG_BUF_SIZE

The technical lower bound of COAP_DEBUG_BUF_SIZE in the code is 5.
Sensible values should be significantly larger than 32 to ensure that
information can be displayed through this buffer.
This commit is contained in:
Olaf Bergmann committed 2020-11-13 09:25:20 +01:00
1 parent 9e0fe9a14f
commit ae9429fc20
1 file changed
+4
+4
View File
@@ -473,6 +473,10 @@ is_binary(int content_format) {
*
*/
#if COAP_DEBUG_BUF_SIZE < 5
#error "COAP_DEBUG_BUF_SIZE must be at least 5, should be >= 32 to be useful"
#endif /* COAP_DEBUG_BUF_SIZE < 5 */
void
coap_show_pdu(coap_log_t level, const coap_pdu_t *pdu) {
#if COAP_CONSTRAINED_STACK