From 1e3473ec5c06e96d86e843d66c1e926f4aac776e Mon Sep 17 00:00:00 2001 From: Vincent Lefevre Date: Tue, 19 Jun 2018 09:37:56 +0200 Subject: [PATCH] Reset errno to 0 before calling strtol and testing it in mutt_atol. Otherwise providing LONG_MAX+1 then LONG_MAX gave an error for LONG_MAX too. --- lib.c | 1 + 1 file changed, 1 insertion(+) diff --git a/lib.c b/lib.c index 583d2fff..f008aae0 100644 --- a/lib.c +++ b/lib.c @@ -1077,6 +1077,7 @@ int mutt_atol (const char *str, long *dst) return 0; } + errno = 0; *res = strtol (str, &e, 10); if ((*res == LONG_MAX && errno == ERANGE) || (e && *e != '\0')) -- 2.40.0