[30778] in CVS-changelog-for-Kerberos-V5

home help back first fref pref prev next nref lref last post

krb5 commit: Correct formatting of trace log microseconds

daemon@ATHENA.MIT.EDU (Greg Hudson)
Wed Apr 8 16:01:01 2020

Date: Wed, 8 Apr 2020 16:00:37 -0400
From: Greg Hudson <ghudson@mit.edu>
Message-ID: <202004082000.038K0b9Q022617@drugstore.mit.edu>
To: <cvs-krb5@mit.edu>
MIME-Version: 1.0
Reply-To: krbdev@mit.edu
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Errors-To: cvs-krb5-bounces@mit.edu

https://github.com/krb5/krb5/commit/734bf341da54e09add9160e65ea7308072b97f13
commit 734bf341da54e09add9160e65ea7308072b97f13
Author: Greg Hudson <ghudson@mit.edu>
Date:   Fri Apr 3 01:04:06 2020 -0400

    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.
    
    ticket: 8894 (new)
    tags: pullup
    target_version: 1.18-next
    target_version: 1.17-next

 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);
_______________________________________________
cvs-krb5 mailing list
cvs-krb5@mit.edu
https://mailman.mit.edu/mailman/listinfo/cvs-krb5

home help back first fref pref prev next nref lref last post