about summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--xombrero.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/xombrero.c b/xombrero.c
index 4ede076..99e956f 100644
--- a/xombrero.c
+++ b/xombrero.c
@@ -7902,7 +7902,8 @@ main(int argc, char **argv)
 			err(1, "fgets");
 		sodversion[strcspn(sodversion, "\n")] = '\0';
 		if (strcmp(version, sodversion)) {
-			rewind(f);
+			if ((f = freopen(file, "w", f)) == NULL)
+				err(1, "startofday");
 			if (fputs(version, f) == EOF)
 				err(1, "fputs");