X-Git-Url: http://git.scottworley.com/tl-append/blobdiff_plain/83acbf7efdd47b20e3107cf2cba49f83a46606d3..2998af81dfb7be9b5c1cfe6d7e5a5a167ebbfd81:/tl-append.c?ds=sidebyside diff --git a/tl-append.c b/tl-append.c index c2f476f..f8bacdd 100644 --- a/tl-append.c +++ b/tl-append.c @@ -18,9 +18,14 @@ static void read_line(char *buf) { } 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)