aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/spellfile.c
diff options
context:
space:
mode:
authorJustin M. Keyes <justinkz@gmail.com>2019-09-13 18:51:13 -0700
committerJustin M. Keyes <justinkz@gmail.com>2019-09-13 19:29:25 -0700
commit6aae0e7c943267d2109ae20ec5086791c3b94a5e (patch)
treeb0a8ec8985c5bdfb1882ee847ff64b42c98d3e0a /src/nvim/spellfile.c
parent3344cffe7bf77c984550c01f9405f4d757150d8a (diff)
downloadrneovim-6aae0e7c943267d2109ae20ec5086791c3b94a5e.tar.gz
rneovim-6aae0e7c943267d2109ae20ec5086791c3b94a5e.tar.bz2
rneovim-6aae0e7c943267d2109ae20ec5086791c3b94a5e.zip
lint
Diffstat (limited to 'src/nvim/spellfile.c')
-rw-r--r--src/nvim/spellfile.c22
1 files changed, 14 insertions, 8 deletions
diff --git a/src/nvim/spellfile.c b/src/nvim/spellfile.c
index c6b5dc500d..01daafa09e 100644
--- a/src/nvim/spellfile.c
+++ b/src/nvim/spellfile.c
@@ -1834,23 +1834,29 @@ int spell_check_msm(void)
return FAIL;
// block count = (value * 1024) / SBLOCKSIZE (but avoid overflow)
start = (getdigits_long(&p, true, 0) * 10) / (SBLOCKSIZE / 102);
- if (*p != ',')
+ if (*p != ',') {
return FAIL;
- ++p;
- if (!ascii_isdigit(*p))
+ }
+ p++;
+ if (!ascii_isdigit(*p)) {
return FAIL;
+ }
incr = (getdigits_long(&p, true, 0) * 102) / (SBLOCKSIZE / 10);
- if (*p != ',')
+ if (*p != ',') {
return FAIL;
- ++p;
- if (!ascii_isdigit(*p))
+ }
+ p++;
+ if (!ascii_isdigit(*p)) {
return FAIL;
+ }
added = getdigits_long(&p, true, 0) * 1024;
- if (*p != NUL)
+ if (*p != NUL) {
return FAIL;
+ }
- if (start == 0 || incr == 0 || added == 0 || incr > start)
+ if (start == 0 || incr == 0 || added == 0 || incr > start) {
return FAIL;
+ }
compress_start = start;
compress_inc = incr;