commit 76691bea04fcfb4e898e5822ae57c5b86ec06dbe
parent 1d160a76ec46e7eb4cfa627fb85987059fae55c4
Author: zeertzjq <zeertzjq@outlook.com>
Date: Fri, 20 May 2022 22:23:20 +0800
Merge pull request #18657 from dundargoc/vim-8.2.4985
vim-patch:8.2.4985: PVS warns for possible array underrun
Diffstat:
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/nvim/spell.c b/src/nvim/spell.c
@@ -443,7 +443,7 @@ size_t spell_check(win_T *wp, char_u *ptr, hlf_T *attrp, int *capcol, bool docou
MAXWLEN + 1);
mi.mi_fwordlen = (int)STRLEN(mi.mi_fword);
- if (camel_case) {
+ if (camel_case && mi.mi_fwordlen > 0) {
// introduce a fake word end space into the folded word.
mi.mi_fword[mi.mi_fwordlen - 1] = ' ';
}