mirror of
git://git.sv.gnu.org/coreutils.git
synced 2026-08-06 00:29:44 +02:00
(__xstrtol): Return an error for invalid suffix.
Before, e.g., `split -b 1M' would be silently accepted and treated like `split -b 1'. Reported by Franc,ois.
This commit is contained in:
+4
-1
@@ -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':
|
||||
|
||||
Reference in New Issue
Block a user