mirror of
https://github.com/irssi/irssi.git
synced 2026-08-20 17:12:51 +02:00
is_numeric() returns now FALSE if it was given empty string.
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@514 dbcabf3a-b0e7-0310-adc4-f8d773084564
This commit is contained in:
parent
1a816b15f5
commit
1a655f3575
1 changed files with 3 additions and 0 deletions
|
|
@ -421,6 +421,9 @@ int is_numeric(const char *str, char end_char)
|
||||||
{
|
{
|
||||||
g_return_val_if_fail(str != NULL, FALSE);
|
g_return_val_if_fail(str != NULL, FALSE);
|
||||||
|
|
||||||
|
if (*str == '\0' || *str == end_char)
|
||||||
|
return FALSE;
|
||||||
|
|
||||||
while (*str != '\0' && *str != end_char) {
|
while (*str != '\0' && *str != end_char) {
|
||||||
if (!isdigit(*str)) return FALSE;
|
if (!isdigit(*str)) return FALSE;
|
||||||
str++;
|
str++;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue