From 0c135a2ff40d18ef5cfeb5a0233475ab49ae4973 Mon Sep 17 00:00:00 2001 From: Eliseo Martínez Date: Tue, 4 Nov 2014 15:41:44 +0100 Subject: Fix warnings: ops.c: do_join(): Nonnull violation: FP. Problem: Argument with 'nonnull' attribute passed null @ 3540. http://neovim.org/doc/reports/clang/report-fc14e0.html#EndPath. Diagnostic: False potitive. Rationale : `count` should be >= 2 by function precondition. Resolution: Assert precondition. --- src/nvim/ops.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/nvim/ops.c b/src/nvim/ops.c index e74fcef8d9..a8b0420fca 100644 --- a/src/nvim/ops.c +++ b/src/nvim/ops.c @@ -11,6 +11,7 @@ * op_change, op_yank, do_put, do_join */ +#include #include #include #include @@ -3436,7 +3437,7 @@ int do_join(long count, && has_format_option(FO_REMOVE_COMS); int prev_was_comment; - + assert(count > 1); if (save_undo && u_save((linenr_T)(curwin->w_cursor.lnum - 1), (linenr_T)(curwin->w_cursor.lnum + count)) == FAIL) return FAIL; -- cgit