From 0aba4d825a5b18c5fa937c0426788f61f756e086 Mon Sep 17 00:00:00 2001 From: Zach Gleason Date: Fri, 1 Mar 2019 22:52:03 -0500 Subject: 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 --- src/nvim/ops.c | 1 + 1 file changed, 1 insertion(+) (limited to 'src') 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) { -- cgit