From 02f4610b1cc2f53f2fc1a361512e355cecb89826 Mon Sep 17 00:00:00 2001 From: Axel Lin Date: Tue, 20 Dec 2016 17:18:39 +0800 Subject: [PATCH] mqtt: Use LWIP_ARRAYSIZE to replace hardcoded value Signed-off-by: Axel Lin --- src/apps/mqtt/mqtt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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];