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:15:44 -0400 |
commit | ba8bddac958972b1f119774ae508510726090a78 (patch) | |
tree | 74cf1a02f81f24d88afb9721309dcdbe4a08f107 | |
parent | 03cc033ece30c515a6d7e72c4b37c9b7ca746acd (diff) | |
download | krb5-ba8bddac958972b1f119774ae508510726090a78.tar.gz |
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.17.2
-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 4fff8f38c..d5c71ec2e 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); |