patch 7.4.1061
Problem: Compiler warning for ignoring return value of fwrite().
Solution: Do use the return value. (idea: Charles Campbell)
diff --git a/src/misc2.c b/src/misc2.c
index 65ac886..0aad428 100644
--- a/src/misc2.c
+++ b/src/misc2.c
@@ -6300,8 +6300,9 @@
/*
* 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 @@
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;
}
/*