diff options
author | Greg Hudson <ghudson@mit.edu> | 2020-04-03 01:04:06 -0400 |
---|---|---|
committer | Greg Hudson <ghudson@mit.edu> | 2020-04-10 13:12:07 -0400 |
commit | 9d6dfe0a3e0ad66a86ca475e6ce3d3b5e655aa08 (patch) | |
tree | aabb93e88ef9825d703c6865f160079683964806 | |
parent | b821301f3ce69bae299f77835b3f5e712035d3a3 (diff) | |
download | krb5-9d6dfe0a3e0ad66a86ca475e6ce3d3b5e655aa08.zip krb5-9d6dfe0a3e0ad66a86ca475e6ce3d3b5e655aa08.tar.gz krb5-9d6dfe0a3e0ad66a86ca475e6ce3d3b5e655aa08.tar.bz2 |
Correct formatting of trace log microseconds
Always use six digits with leading 0s to format the microseconds in
trace log timestamps; otherwise a small value appears as too large of
a fraction of a second.
(cherry picked from commit 734bf341da54e09add9160e65ea7308072b97f13)
ticket: 8894
version_fixed: 1.18.1
-rw-r--r-- | src/lib/krb5/os/trace.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/lib/krb5/os/trace.c b/src/lib/krb5/os/trace.c index 2a03ae9..7073459 100644 --- a/src/lib/krb5/os/trace.c +++ b/src/lib/krb5/os/trace.c @@ -411,8 +411,8 @@ krb5int_trace(krb5_context context, const char *fmt, ...) goto cleanup; if (krb5_crypto_us_timeofday(&sec, &usec) != 0) goto cleanup; - if (asprintf(&msg, "[%d] %u.%d: %s\n", (int) getpid(), (unsigned int) sec, - (int) usec, str) < 0) + if (asprintf(&msg, "[%d] %u.%06d: %s\n", (int)getpid(), + (unsigned int)sec, (int)usec, str) < 0) goto cleanup; info.message = msg; context->trace_callback(context, &info, context->trace_callback_data); |