>From ad72efaf534bf61c1c9afa8121aa07808016de3e Mon Sep 17 00:00:00 2001 From: Assaf Gordon Date: Tue, 12 Feb 2013 15:28:22 -0500 Subject: [PATCH] numfmt: fix strtol() bug src/numfmt.c: on some system, strtol() returns EINVAL if no conversion was performed. Ignore and continue if so. Abort only on ERANGE. --- src/numfmt.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/src/numfmt.c b/src/numfmt.c index d87d8ef..9a321d6 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)); -- 1.7.7.4