summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTimo Sirainen <cras@irssi.org>2000-07-23 11:54:54 +0000
committercras <cras@dbcabf3a-b0e7-0310-adc4-f8d773084564>2000-07-23 11:54:54 +0000
commit1a655f357598c9d9f3d2ddbe61a10803ffc73d5b (patch)
treec0920bb33ade3d9a7688940ee6449815c20328e6
parent1a816b15f5af992a90064f13c0b538c5686a5e39 (diff)
downloadirssi-1a655f357598c9d9f3d2ddbe61a10803ffc73d5b.zip
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
-rw-r--r--src/core/misc.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/core/misc.c b/src/core/misc.c
index ed88be1c..b1e2521a 100644
--- a/src/core/misc.c
+++ b/src/core/misc.c
@@ -421,6 +421,9 @@ int is_numeric(const char *str, char end_char)
{
g_return_val_if_fail(str != NULL, FALSE);
+ if (*str == '\0' || *str == end_char)
+ return FALSE;
+
while (*str != '\0' && *str != end_char) {
if (!isdigit(*str)) return FALSE;
str++;