diff options
author | James McCoy <jamessan@jamessan.com> | 2016-09-03 00:55:27 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-09-03 00:55:27 -0400 |
commit | 94dfb6cea24180592af5c495dd9e8abf61d5735f (patch) | |
tree | efd13e949beef00845bc70757ca43c59d4e4a90d | |
parent | 0253766b5d812209320a14c093990e3b417510f9 (diff) | |
parent | a371f1027e443e59a54191b187170b63fcf94a9b (diff) | |
download | rneovim-94dfb6cea24180592af5c495dd9e8abf61d5735f.tar.gz rneovim-94dfb6cea24180592af5c495dd9e8abf61d5735f.tar.bz2 rneovim-94dfb6cea24180592af5c495dd9e8abf61d5735f.zip |
Merge pull request #5286 from jamessan/strtoimax-error-checking
Fix error-handling of strtoimax boundary conditions
-rw-r--r-- | src/nvim/charset.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/nvim/charset.c b/src/nvim/charset.c index 22ca0fb0cc..b5154819b9 100644 --- a/src/nvim/charset.c +++ b/src/nvim/charset.c @@ -1739,8 +1739,11 @@ char_u* skiptowhite_esc(char_u *p) { /// @return Number read from the string. intmax_t getdigits(char_u **pp) { + errno = 0; intmax_t number = strtoimax((char *)*pp, (char **)pp, 10); - assert(errno != ERANGE); + if (number == INTMAX_MAX || number == INTMAX_MIN) { + assert(errno != ERANGE); + } return number; } |