mirror of
https://github.com/lwip-tcpip/lwip.git
synced 2025-03-12 22:14:25 +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 *
|
static const char *
|
||||||
mqtt_msg_type_to_str(u8_t msg_type)
|
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;
|
msg_type = 0;
|
||||||
}
|
}
|
||||||
return mqtt_message_type_str[msg_type];
|
return mqtt_message_type_str[msg_type];
|
||||||
|
Loading…
x
Reference in New Issue
Block a user