Lets make sure milliseconds are formatted nicely.

This commit is contained in:
Joris Vink 2021-09-14 09:36:33 +02:00
parent 41511c1683
commit a2d48feeb7
1 changed files with 1 additions and 1 deletions

View File

@ -150,7 +150,7 @@ log_print(int prio, const char *fmt, ...)
t = gmtime(&ts.tv_sec);
if (strftime(tbuf, sizeof(tbuf), "%Y-%m-%d %H:%M:%S", t) > 0)
fprintf(fp, "%s.%ld UTC ", tbuf, ts.tv_nsec / 1000000);
fprintf(fp, "%s.%03ld UTC ", tbuf, ts.tv_nsec / 1000000);
vfprintf(fp, fmt, args);
fflush(fp);