diff options
author | Zach Gleason <zgleason94@gmail.com> | 2019-03-01 22:52:03 -0500 |
---|---|---|
committer | Justin M. Keyes <justinkz@gmail.com> | 2019-03-02 04:52:03 +0100 |
commit | 0aba4d825a5b18c5fa937c0426788f61f756e086 (patch) | |
tree | 26a5a9983b0105eaf12a73fa03d76f77b030b58d /src | |
parent | 8ba484ab6943a64ff40deb2abdc789fccd00e61c (diff) | |
download | rneovim-0aba4d825a5b18c5fa937c0426788f61f756e086.tar.gz rneovim-0aba4d825a5b18c5fa937c0426788f61f756e086.tar.bz2 rneovim-0aba4d825a5b18c5fa937c0426788f61f756e086.zip |
ops.c: do_join expects `count` of 2 or greater #6855
test_normal.vim fails if we assert >= 2, so we only check >= 1. That at
least avoids invalid pointers.
TEST_FILE=test_normal.res make oldtest
Diffstat (limited to 'src')
-rw-r--r-- | src/nvim/ops.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/nvim/ops.c b/src/nvim/ops.c index 9d9ee0c9e3..99dee939fc 100644 --- a/src/nvim/ops.c +++ b/src/nvim/ops.c @@ -3608,6 +3608,7 @@ int do_join(size_t count, int remove_comments = (use_formatoptions == TRUE) && has_format_option(FO_REMOVE_COMS); bool prev_was_comment = false; + assert(count >= 1); if (save_undo && u_save(curwin->w_cursor.lnum - 1, curwin->w_cursor.lnum + (linenr_T)count) == FAIL) { |