]> granicus.if.org Git - neomutt/commit
mutt_str_atol: better error handling
authorVincent Lefevre <vincent@vinc17.net>
Tue, 19 Jun 2018 07:37:56 +0000 (09:37 +0200)
committerRichard Russon <rich@flatcap.org>
Wed, 20 Jun 2018 15:19:20 +0000 (16:19 +0100)
commitee9c657b1ac942499ae356add472f903de85ecaa
tree402d34fa1e98335f971983c63523354f852654cc
parentb8466bf029ea6ec1c409c65b75e6b7a1820b9635
mutt_str_atol: better error handling

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.

* Detect overflow on negative numbers too (< LONG_MIN).

* Distinguish between format error and number overflow as already
  expected (e.g. for pgp_timeout and smime_timeout).
mutt/string.c