From: Jim Meyering Date: Sat, 25 Jan 1997 06:13:46 +0000 (+0000) Subject: (__xstrtol): Change interpretation of X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=555837e850b94c076f8271952fe52f3238cc9a4f;p=pspp (__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. --- 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')