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.
This commit is contained in:
Eliseo Martínez 2014-11-04 15:41:44 +01:00
parent bd7ee7d6a9
commit 0c135a2ff4

View File

@ -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;