Mercurial > vim
diff src/misc2.c @ 7519:98fede2c9574 v7.4.1061
commit https://github.com/vim/vim/commit/285bf84b4b9aca828828a8729b04cd59ab333dac
Author: Bram Moolenaar <Bram@vim.org>
Date: Thu Jan 7 22:34:01 2016 +0100
patch 7.4.1061
Problem: Compiler warning for ignoring return value of fwrite().
Solution: Do use the return value. (idea: Charles Campbell)
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Thu, 07 Jan 2016 22:45:04 +0100 |
parents | 37e061ec063c |
children | 30b74472ff81 |
line wrap: on
line diff
--- a/src/misc2.c +++ b/src/misc2.c @@ -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; } /*