Do not use g_return_val_if_fail() in sub_pattern_to_int(), no number is not an error

master
Yevgen Muntyan 2006-08-28 21:06:38 -05:00
parent b5825f26a1
commit 120f8ba116
1 changed files with 3 additions and 1 deletions

View File

@ -2121,7 +2121,9 @@ sub_pattern_to_int (const gchar *name)
errno = 0;
number = g_ascii_strtoull (name, &end_name, 10);
g_return_val_if_fail (!errno && number < G_MAXINT && !*end_name, -1);
if (errno !=0 || number > G_MAXINT || *end_name != 0)
return -1;
return number;
}