summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>1997-01-25 06:13:46 +0000
committerJim Meyering <jim@meyering.net>1997-01-25 06:13:46 +0000
commit555837e850b94c076f8271952fe52f3238cc9a4f (patch)
tree0f68a61b5c59fdbcc0d9ab2aecce4e1abe9c91eb
parent8cc396bce284ce7644f2e97c866b697670c3564c (diff)
downloadgnulib-555837e850b94c076f8271952fe52f3238cc9a4f.tar.gz
(__xstrtol): Change interpretation of
VALID_SUFFIXES == NULL vs VALID_SUFFIXES == "". Use the former when any suffix is valid, the later when no suffix is allowed.
-rw-r--r--lib/xstrtol.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/lib/xstrtol.c b/lib/xstrtol.c
index fea6c4801a..ad2bcdbf10 100644
--- a/lib/xstrtol.c
+++ b/lib/xstrtol.c
@@ -91,15 +91,14 @@ __xstrtol (s, ptr, base, val, valid_suffixes)
return LONGINT_OVERFLOW;
if (*p == s)
return LONGINT_INVALID;
+
+ /* Let valid_suffixes == NULL mean `allow any suffix'. */
+ /* FIXME: update all callers except the one in tail.c changing
+ last parameter NULL to `""'. */
if (!valid_suffixes)
{
- if (**p == '\0')
- {
- *val = tmp;
- return LONGINT_OK;
- }
- else
- return LONGINT_INVALID_SUFFIX_CHAR;
+ *val = tmp;
+ return LONGINT_OK;
}
if (**p != '\0')