mirror of
https://github.com/lwip-tcpip/lwip.git
synced 2025-03-12 04:13:55 +00:00
mqtt: Use LWIP_ARRAYSIZE to replace hardcoded value
Signed-off-by: Axel Lin <axel.lin@ingics.com>
This commit is contained in:
parent
b6a131edfb
commit
02f4610b1c
@ -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];
|
||||
|
Loading…
x
Reference in New Issue
Block a user