diff options
author | Andrew Gregory <andrew.gregory.8@gmail.com> | 2019-06-08 21:50:45 +0200 |
---|---|---|
committer | Allan McRae <allan@archlinux.org> | 2019-06-20 09:00:53 +0200 |
commit | 30acc87b7dfb1d0cf3b7ca5097e47b595b798076 (patch) | |
tree | fda0435615377c988e9d033eb7a05f00d2ace866 /lib | |
parent | 686a9ee8e7775fc8d701e0de8dde06a3b39df8e6 (diff) | |
download | pacman-30acc87b7dfb1d0cf3b7ca5097e47b595b798076.tar.gz pacman-30acc87b7dfb1d0cf3b7ca5097e47b595b798076.tar.xz |
use consistent time notation for the log
%X is locale-dependent, making it impossible to reliably parse and
potentially overflowing the buffer. %T is consistent across locales.
Also fixes some adjacent whitespace.
Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/libalpm/log.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/libalpm/log.c b/lib/libalpm/log.c index d8842a55..2ff5544b 100644 --- a/lib/libalpm/log.c +++ b/lib/libalpm/log.c @@ -39,11 +39,11 @@ static int _alpm_log_leader(FILE *f, const char *prefix) { time_t t = time(NULL); struct tm *tm = localtime(&t); - int length = 32; - char timestamp[length]; + int length = 32; + char timestamp[length]; /* Use ISO-8601 date format */ - strftime(timestamp,length,"%FT%X%z", tm); + strftime(timestamp,length,"%FT%T%z", tm); return fprintf(f, "[%s] [%s] ", timestamp, prefix); } |