From 25eaa1496be7292be5a5c9c5b56ca32d6288960c Mon Sep 17 00:00:00 2001 From: Marco Peereboom Date: Thu, 1 Mar 2012 15:20:52 -0600 Subject: Linux doesn't play nice with fputs return values, found the hard way by Ryan Mullen , based on his patch --- xxxterm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/xxxterm.c b/xxxterm.c index c641fd1..c9650ad 100644 --- a/xxxterm.c +++ b/xxxterm.c @@ -7781,7 +7781,7 @@ main(int argc, char **argv) warnx("start of day file doesn't exist, creating it"); if ((f = fopen(file, "w")) == NULL) err(1, "startofday"); - if (fputs(version, f)) + if (fputs(version, f) == EOF) err(1, "fputs"); fclose(f); @@ -7795,7 +7795,7 @@ main(int argc, char **argv) sodversion[strcspn(sodversion, "\n")] = '\0'; if (strcmp(version, sodversion)) { rewind(f); - if (fputs(version, f)) + if (fputs(version, f) == EOF) err(1, "fputs"); /* upgrade, say something smart */ -- cgit 1.4.1-2-gfad0