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
Greg Hudson
4 years ago
410 | 410 | goto cleanup; |
411 | 411 | if (krb5_crypto_us_timeofday(&sec, &usec) != 0) |
412 | 412 | goto cleanup; |
413 | if (asprintf(&msg, "[%d] %u.%d: %s\n", (int) getpid(), (unsigned int) sec, | |
414 | (int) usec, str) < 0) | |
413 | if (asprintf(&msg, "[%d] %u.%06d: %s\n", (int)getpid(), | |
414 | (unsigned int)sec, (int)usec, str) < 0) | |
415 | 415 | goto cleanup; |
416 | 416 | info.message = msg; |
417 | 417 | context->trace_callback(context, &info, context->trace_callback_data); |