diff options
author | Eliseo Martínez <eliseomarmol@gmail.com> | 2014-11-04 15:41:44 +0100 |
---|---|---|
committer | Eliseo Martínez <eliseomarmol@gmail.com> | 2014-11-06 09:51:44 +0100 |
commit | 0c135a2ff40d18ef5cfeb5a0233475ab49ae4973 (patch) | |
tree | 02a73b0e65ae61bab626d62ddf0a0a5859285049 /src/nvim/ops.c | |
parent | bd7ee7d6a95d8d2fa1162c4169418e0ed13af7a9 (diff) | |
download | rneovim-0c135a2ff40d18ef5cfeb5a0233475ab49ae4973.tar.gz rneovim-0c135a2ff40d18ef5cfeb5a0233475ab49ae4973.tar.bz2 rneovim-0c135a2ff40d18ef5cfeb5a0233475ab49ae4973.zip |
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.
Diffstat (limited to 'src/nvim/ops.c')
-rw-r--r-- | src/nvim/ops.c | 3 |
1 files changed, 2 insertions, 1 deletions
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 <assert.h> #include <inttypes.h> #include <stdbool.h> #include <string.h> @@ -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; |