mirror of
https://github.com/wolfSSL/wolfssl.git
synced 2025-07-30 18:57:27 +02:00
src/sniffer.c: fixes for cppcheck complaints: negativeIndex
This commit is contained in:
@ -364,7 +364,7 @@ static const char* const msgTable[] =
|
||||
static void GetError(int idx, char* str)
|
||||
{
|
||||
if (str == NULL ||
|
||||
idx < 0 || idx > (int)(sizeof(msgTable)/sizeof(const char* const)))
|
||||
idx <= 0 || idx > (int)(sizeof(msgTable)/sizeof(const char* const)))
|
||||
return;
|
||||
XSTRNCPY(str, msgTable[idx - 1], MAX_ERROR_LEN-1);
|
||||
str[MAX_ERROR_LEN-1] = '\0';
|
||||
|
Reference in New Issue
Block a user