Skip to content

Commit

Permalink
fix: bounds check for underdot
Browse files Browse the repository at this point in the history
  • Loading branch information
kchibisov committed Mar 5, 2022
1 parent 6795c97 commit 7fd1182
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/nvim/eval/funcs.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 7fd1182

Please sign in to comment.