X-Git-Url: http://git.scottworley.com/tl-append/blobdiff_plain/bab98a3a230bcc2161254e5796ec97e1391b4907..ef591a4f51a7a2816d553cdd996eff4bb80ad710:/common.c diff --git a/common.c b/common.c index 1bc1102..5f4d993 100644 --- a/common.c +++ b/common.c @@ -1,10 +1,27 @@ +/* + * tl-append: time-logger appending shell + * Copyright (C) 2023 Scott Worley + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, version 3. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + #define _POSIX_C_SOURCE 2 #include "common.h" #include #include -const char *FILENAME = "tl.log"; +const char *const FILENAME = "tl.log"; void die(const char *message) { fputs(message, stderr); @@ -17,7 +34,7 @@ void die_err(const char *message) { exit(1); } -const char *encode_time(time_t t) { +char *encode_time(time_t t) { struct tm tm; localtime_r(&t, &tm); const size_t size = 20;