}
static void write_line(const char *line) {
+ const char *now = encode_time(time(NULL));
FILE *f = fopen(FILENAME, "a");
if (f == NULL)
die_err("Error opening output file");
+ if (fputs(now, f) == EOF)
+ die("Error writing to output file");
+ if (fputc(' ', f) == EOF)
+ die("Error writing to output file");
if (fputs(line, f) == EOF)
die("Error writing to output file");
if (fclose(f) != 0)