projects
/
platform
/
upstream
/
coreutils.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
54cdb0e
)
numfmt: fix strtol() return code handling
author
Assaf Gordon
<assafgordon@gmail.com>
Tue, 12 Feb 2013 20:28:22 +0000
(15:28 -0500)
committer
Pádraig Brady
<P@draigBrady.com>
Wed, 13 Feb 2013 22:20:10 +0000
(22:20 +0000)
src/numfmt.c (parse_format_string): On some systems, strtol() returns
EINVAL if no conversion was performed. So only handle ERANGE here,
and handle other format errors directly.
src/numfmt.c
patch
|
blob
|
history
diff --git
a/src/numfmt.c
b/src/numfmt.c
index
d87d8ef
..
9a321d6
100644
(file)
--- a/
src/numfmt.c
+++ b/
src/numfmt.c
@@
-970,7
+970,7
@@
parse_format_string (char const *fmt)
i += strspn (fmt + i, " ");
errno = 0;
pad = strtol (fmt + i, &endptr, 10);
- if (errno
!= 0
)
+ if (errno
== ERANGE
)
error (EXIT_FAILURE, 0,
_("invalid format %s (width overflow)"), quote (fmt));