]> granicus.if.org Git - vim/commitdiff
patch 8.2.2828: Coverity complains about not checking rename() return value v8.2.2828
authorBram Moolenaar <Bram@vim.org>
Mon, 3 May 2021 17:49:51 +0000 (19:49 +0200)
committerBram Moolenaar <Bram@vim.org>
Mon, 3 May 2021 17:49:51 +0000 (19:49 +0200)
Problem:    Coverity complains about not checking the rename() return value.
Solution:   Add "(void)", can't do anything in case of a failure.

src/fileio.c
src/version.c

index 1af0b4c59fdce821a6d45396a12f6da9e3cc2bbe..b59c01d267b19947aa0bf4c675eb8e2952c073d5 100644 (file)
@@ -3733,7 +3733,7 @@ vim_rename(char_u *from, char_u *to)
                        return 0;
                    // Strange, the second step failed.  Try moving the
                    // file back and return failure.
-                   mch_rename(tempname, (char *)from);
+                   (void)mch_rename(tempname, (char *)from);
                    return -1;
                }
                // If it fails for one temp name it will most likely fail
index f20c0099d6f6a946362a560178f8d0ec2bd2af36..444f35fdaae1d47fbe6a094bb61a2944b2105a6a 100644 (file)
@@ -750,6 +750,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    2828,
 /**/
     2827,
 /**/