projects
/
pspp
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
040465a
)
(__xstrtol): Return an error for invalid suffix.
author
Jim Meyering
<jim@meyering.net>
Sun, 13 Oct 1996 17:58:50 +0000
(17:58 +0000)
committer
Jim Meyering
<jim@meyering.net>
Sun, 13 Oct 1996 17:58:50 +0000
(17:58 +0000)
Before, e.g., `split -b 1M' would be silently accepted and treated
like `split -b 1'. Reported by Franc,ois.
lib/xstrtol.c
patch
|
blob
|
history
diff --git
a/lib/xstrtol.c
b/lib/xstrtol.c
index 8755cf475dd75f2f9a5b5bebfbbf00c1a1153585..dec0ec79be38bdc05a3a5b530c41139a5b79b76d 100644
(file)
--- 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':