summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/xstrtol.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/xstrtol.c b/lib/xstrtol.c
index 8755cf475..dec0ec79b 100644
--- a/lib/xstrtol.c
+++ b/lib/xstrtol.c
@@ -102,8 +102,11 @@ __xstrtol (s, ptr, base, val, valid_suffixes)
return LONGINT_INVALID_SUFFIX_CHAR;
}
- if (**p != '\0' && strchr (valid_suffixes, **p))
+ if (**p != '\0')
{
+ if (!strchr (valid_suffixes, **p))
+ return LONGINT_INVALID_SUFFIX_CHAR;
+
switch (**p)
{
case 'b':