mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
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:
parent
bd7ee7d6a9
commit
0c135a2ff4
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user