diff options
author | Bram Moolenaar <Bram@vim.org> | 2020-11-21 14:16:22 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2020-11-21 14:16:22 +0100 |
commit | 5546688fb6798d37a770f366c13dedfa7e4cb417 (patch) | |
tree | 990e4d21457bb84fbed3ef8abf55e9cc63e5a97f /src/ops.c | |
parent | 896ad2c33e562e4b674b7e0efbd43be85a64acc8 (diff) | |
download | vim-git-5546688fb6798d37a770f366c13dedfa7e4cb417.tar.gz |
patch 8.2.2029: Coverity warns for not checking return valuev8.2.2029
Problem: Coverity warns for not checking return value.
Solution: Check that u_save_cursor() returns OK.
Diffstat (limited to 'src/ops.c')
-rw-r--r-- | src/ops.c | 7 |
1 files changed, 4 insertions, 3 deletions
@@ -3871,9 +3871,10 @@ do_pending_operator(cmdarg_T *cap, int old_col, int gui_yank) else { (void)op_delete(oap); - if (oap->motion_type == MLINE && has_format_option(FO_AUTO)) - u_save_cursor(); // cursor line wasn't saved yet - auto_format(FALSE, TRUE); + // save cursor line for undo if it wasn't saved yet + if (oap->motion_type == MLINE && has_format_option(FO_AUTO) + && u_save_cursor() == OK) + auto_format(FALSE, TRUE); } break; |