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>
This commit is contained in:
parent
686a9ee8e7
commit
30acc87b7d
1 changed files with 3 additions and 3 deletions
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue