]> granicus.if.org Git - vim/commitdiff
patch 7.4.1061 v7.4.1061
authorBram Moolenaar <Bram@vim.org>
Thu, 7 Jan 2016 21:34:01 +0000 (22:34 +0100)
committerBram Moolenaar <Bram@vim.org>
Thu, 7 Jan 2016 21:34:01 +0000 (22:34 +0100)
Problem:    Compiler warning for ignoring return value of fwrite().
Solution:   Do use the return value. (idea: Charles Campbell)

src/misc2.c
src/proto/misc2.pro
src/version.c

index 65ac886cfe802679950685aea5a900cd2d6c3ecf..0aad4282199d2ef9a9f48e1905646208f7c029fe 100644 (file)
@@ -6300,8 +6300,9 @@ put_bytes(fd, nr, len)
 
 /*
  * Write time_t to file "fd" in 8 bytes.
+ * Returns FAIL when the write failed.
  */
-    void
+    int
 put_time(fd, the_time)
     FILE       *fd;
     time_t     the_time;
@@ -6309,7 +6310,7 @@ put_time(fd, the_time)
     char_u     buf[8];
 
     time_to_bytes(the_time, buf);
-    (void)fwrite(buf, (size_t)8, (size_t)1, fd);
+    return fwrite(buf, (size_t)8, (size_t)1, fd) == 1 ? OK : FAIL;
 }
 
 /*
index 4a955e32faebe673f2392c1592eef66f48a0fbf7..35e1a8ec863fd04f9cc2d08f656ef431184b4bc4 100644 (file)
@@ -105,7 +105,7 @@ int get4c __ARGS((FILE *fd));
 time_t get8ctime __ARGS((FILE *fd));
 char_u *read_string __ARGS((FILE *fd, int cnt));
 int put_bytes __ARGS((FILE *fd, long_u nr, int len));
-void put_time __ARGS((FILE *fd, time_t the_time));
+int put_time __ARGS((FILE *fd, time_t the_time));
 void time_to_bytes __ARGS((time_t the_time, char_u *buf));
 int has_non_ascii __ARGS((char_u *s));
 void parse_queued_messages __ARGS((void));
index 23bd3f72ebfea2812d8b78952df9cbf6a01c4cda..1b42524a28d446c417ccca6913dce4164376f793 100644 (file)
@@ -741,6 +741,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    1061,
 /**/
     1060,
 /**/