diff options
author | Kirill Chibisov <contact@kchibisov.com> | 2022-03-05 19:16:14 +0300 |
---|---|---|
committer | Kirill Chibisov <contact@kchibisov.com> | 2022-03-05 19:16:14 +0300 |
commit | 7fd1182c62d6e969ac15b3891bfcc4ff480d6953 (patch) | |
tree | 4b0179837c651caf414562f798330c536fe058ee | |
parent | 6795c9772b07a7eeb154bf9cc132bf50fa4ddcaa (diff) | |
download | rneovim-7fd1182c62d6e969ac15b3891bfcc4ff480d6953.tar.gz rneovim-7fd1182c62d6e969ac15b3891bfcc4ff480d6953.tar.bz2 rneovim-7fd1182c62d6e969ac15b3891bfcc4ff480d6953.zip |
fix: bounds check for underdot
-rw-r--r-- | src/nvim/eval/funcs.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/nvim/eval/funcs.c b/src/nvim/eval/funcs.c index b688e087ed..8a1b6f081b 100644 --- a/src/nvim/eval/funcs.c +++ b/src/nvim/eval/funcs.c @@ -11410,14 +11410,14 @@ static void f_synIDattr(typval_T *argvars, typval_T *rettv, FunPtr fptr) } break; case 'u': { - int len = STRLEN(what); + const size_t len = STRLEN(what); if (len <= 5 || (TOLOWER_ASC(what[5]) == 'l' && len <= 9)) { // underline p = highlight_has_attr(id, HL_UNDERCURL, modec); } else if (TOLOWER_ASC(what[5]) == 'c') { // undercurl p = highlight_has_attr(id, HL_UNDERCURL, modec); } else if (len > 9 && TOLOWER_ASC(what[9]) == 'l') { // underlineline p = highlight_has_attr(id, HL_UNDERLINELINE, modec); - } else if (len > 5 && TOLOWER_ASC(what[6]) == 'o') { // underdot + } else if (len > 6 && TOLOWER_ASC(what[6]) == 'o') { // underdot p = highlight_has_attr(id, HL_UNDERDOT, modec); } else { // underdash p = highlight_has_attr(id, HL_UNDERDASH, modec); |