From fff11aca4faaee33a032cb11d7453c6e938b71b7 Mon Sep 17 00:00:00 2001 From: Assaf Gordon Date: Tue, 12 Feb 2013 15:28:22 -0500 Subject: numfmt: fix strtol() return code handling 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 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/numfmt.c b/src/numfmt.c index d87d8efce..9a321d697 100644 --- 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)); -- cgit v1.2.3-54-g00ecf