Mercurial > hg > octave-kai > gnulib-hg
changeset 870:09bc76111e29
(__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.
author | Jim Meyering <jim@meyering.net> |
---|---|
date | Sat, 25 Jan 1997 06:13:46 +0000 |
parents | ca8a87089389 |
children | 759a0cbe32e1 |
files | lib/xstrtol.c |
diffstat | 1 files changed, 6 insertions(+), 7 deletions(-) [+] |
line wrap: on
line diff
--- a/lib/xstrtol.c +++ b/lib/xstrtol.c @@ -91,15 +91,14 @@ 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')