aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/ops.c
diff options
context:
space:
mode:
authorChristian Clason <c.clason@uni-graz.at>2022-01-26 22:39:45 +0100
committerGitHub <noreply@github.com>2022-01-26 22:39:45 +0100
commit6006e15e7ac055de1e87bbd12d17d017dfa8737f (patch)
tree642c79cdb1a78647d0ad400fb02e5b90fb67e996 /src/nvim/ops.c
parent17e2938b100070d91bd956c8734760ca16f6d3f2 (diff)
parent540264306b6340bdd8133cd3307b169f7708c4d6 (diff)
downloadrneovim-6006e15e7ac055de1e87bbd12d17d017dfa8737f.tar.gz
rneovim-6006e15e7ac055de1e87bbd12d17d017dfa8737f.tar.bz2
rneovim-6006e15e7ac055de1e87bbd12d17d017dfa8737f.zip
Merge pull request #17205 from clason/vim-8.2.4214
Vim 8.2.{4214,4215,4217,4219} various illegal memory accesses
Diffstat (limited to 'src/nvim/ops.c')
-rw-r--r--src/nvim/ops.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/nvim/ops.c b/src/nvim/ops.c
index 2bc92ce295..b2554cbf0d 100644
--- a/src/nvim/ops.c
+++ b/src/nvim/ops.c
@@ -2801,7 +2801,7 @@ static void yank_copy_line(yankreg_T *reg, struct block_def *bd, size_t y_idx,
if (exclude_trailing_space) {
int s = bd->textlen + bd->endspaces;
- while (ascii_iswhite(*(bd->textstart + s - 1)) && s > 0) {
+ while (s > 0 && ascii_iswhite(*(bd->textstart + s - 1))) {
s = s - utf_head_off(bd->textstart, bd->textstart + s - 1) - 1;
pnew--;
}