diff --git a/src/apps/mqtt/mqtt.c b/src/apps/mqtt/mqtt.c index 0bc3ab0a..08134116 100644 --- a/src/apps/mqtt/mqtt.c +++ b/src/apps/mqtt/mqtt.c @@ -169,7 +169,7 @@ static const char * const mqtt_message_type_str[15] = static const char * mqtt_msg_type_to_str(u8_t msg_type) { - if(msg_type > 14) { + if(msg_type >= LWIP_ARRAYSIZE(mqtt_message_type_str)) { msg_type = 0; } return mqtt_message_type_str[msg_type];