Skip to content

Commit 285bf84

Browse files
committed
patch 7.4.1061
Problem: Compiler warning for ignoring return value of fwrite(). Solution: Do use the return value. (idea: Charles Campbell)
1 parent 6602af7 commit 285bf84

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

src/misc2.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6300,16 +6300,17 @@ put_bytes(fd, nr, len)
63006300

63016301
/*
63026302
* Write time_t to file "fd" in 8 bytes.
6303+
* Returns FAIL when the write failed.
63036304
*/
6304-
void
6305+
int
63056306
put_time(fd, the_time)
63066307
FILE *fd;
63076308
time_t the_time;
63086309
{
63096310
char_u buf[8];
63106311

63116312
time_to_bytes(the_time, buf);
6312-
(void)fwrite(buf, (size_t)8, (size_t)1, fd);
6313+
return fwrite(buf, (size_t)8, (size_t)1, fd) == 1 ? OK : FAIL;
63136314
}
63146315

63156316
/*

src/proto/misc2.pro

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ int get4c __ARGS((FILE *fd));
105105
time_t get8ctime __ARGS((FILE *fd));
106106
char_u *read_string __ARGS((FILE *fd, int cnt));
107107
int put_bytes __ARGS((FILE *fd, long_u nr, int len));
108-
void put_time __ARGS((FILE *fd, time_t the_time));
108+
int put_time __ARGS((FILE *fd, time_t the_time));
109109
void time_to_bytes __ARGS((time_t the_time, char_u *buf));
110110
int has_non_ascii __ARGS((char_u *s));
111111
void parse_queued_messages __ARGS((void));

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -741,6 +741,8 @@ static char *(features[]) =
741741

742742
static int included_patches[] =
743743
{ /* Add new patch number below this line */
744+
/**/
745+
1061,
744746
/**/
745747
1060,
746748
/**/

0 commit comments

Comments
 (0)