irc: return 0 in function irc_protocol_is_numeric_command if the command is NULL or empty

v2.8-utf8proc
Sébastien Helleu 2020-03-10 19:15:59 +01:00
parent 8a5046f0a1
commit 2fe27584ff
1 changed files with 4 additions and 0 deletions

View File

@ -69,12 +69,16 @@
int
irc_protocol_is_numeric_command (const char *str)
{
if (!str || !str[0])
return 0;
while (str && str[0])
{
if (!isdigit ((unsigned char)str[0]))
return 0;
str++;
}
return 1;
}