about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorMarco Peereboom <marco@conformal.com>2012-03-01 15:20:52 -0600
committerMarco Peereboom <marco@conformal.com>2012-03-01 15:20:52 -0600
commit25eaa1496be7292be5a5c9c5b56ca32d6288960c (patch)
treef28eec7b171afde05059c0b547143590e28fd242
parent8e19183fe3c9654c1be8084341cd3e99031104ae (diff)
downloadxombrero-25eaa1496be7292be5a5c9c5b56ca32d6288960c.tar.gz
Linux doesn't play nice with fputs return values, found the hard way by Ryan Mullen <rmmullen@gmail.com>, based on his patch
-rw-r--r--xxxterm.c4
1 files 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 */