]>
git.scottworley.com Git - tl-append/blob - common.c
1 #define _POSIX_C_SOURCE 2
7 const char *const FILENAME
= "tl.log";
9 void die(const char *message
) {
10 fputs(message
, stderr
);
15 void die_err(const char *message
) {
20 char *encode_time(time_t t
) {
23 const size_t size
= 20;
24 char *out
= (char *)malloc(size
);
25 if (strftime(out
, size
, "%Y %m %d %H %M %S", &tm
) != size
- 1)
26 die("Couldn't format time");