From 3344cffe7bf77c984550c01f9405f4d757150d8a Mon Sep 17 00:00:00 2001 From: "Justin M. Keyes" Date: Fri, 13 Sep 2019 18:15:09 -0700 Subject: getdigits: introduce `strict`, `def` parameters Problem: During a refactor long ago, we changed the `getdigits_*` familiy of functions to abort on overflow. But this is often wrong, because many of these codepaths are handling user input. Solution: Decide at each call-site whether to use "strict" mode. fix #5555 --- src/nvim/spell.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/nvim/spell.c') diff --git a/src/nvim/spell.c b/src/nvim/spell.c index 0cde781fc3..7152c3e451 100644 --- a/src/nvim/spell.c +++ b/src/nvim/spell.c @@ -2706,7 +2706,7 @@ int spell_check_sps(void) f = 0; if (ascii_isdigit(*buf)) { s = buf; - sps_limit = getdigits_int(&s); + sps_limit = getdigits_int(&s, true, 0); if (*s != NUL && !ascii_isdigit(*s)) f = -1; } else if (STRCMP(buf, "best") == 0) -- cgit