]> granicus.if.org Git - vim/commitdiff
patch 8.2.2029: Coverity warns for not checking return value v8.2.2029
authorBram Moolenaar <Bram@vim.org>
Sat, 21 Nov 2020 13:16:22 +0000 (14:16 +0100)
committerBram Moolenaar <Bram@vim.org>
Sat, 21 Nov 2020 13:16:22 +0000 (14:16 +0100)
Problem:    Coverity warns for not checking return value.
Solution:   Check that u_save_cursor() returns OK.

src/ops.c
src/version.c

index 417bb1621d6880ac56009d5bf53b72f0c9b6d83a..b83394e01de277e8376b273bb8596c7fb4e9d373 100644 (file)
--- a/src/ops.c
+++ b/src/ops.c
@@ -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;
 
index 0583f64b94c3691dcb59e05c61a11f348568a778..8e9d8103c996fa5a6c8cfcb4e3c89832b3e8d8bc 100644 (file)
@@ -750,6 +750,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    2029,
 /**/
     2028,
 /**/