Improve display of error code 0 in trace output
authorGreg Hudson <ghudson@mit.edu>
Tue, 8 May 2012 03:04:12 +0000 (03:04 +0000)
committerGreg Hudson <ghudson@mit.edu>
Tue, 8 May 2012 03:04:12 +0000 (03:04 +0000)
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@25853 dc483132-0cff-0310-8789-dd5450dbe970

src/lib/krb5/os/trace.c

index 309ffa154b7277fee8f7595232a23674874067e9..a231ca04d1fd1cbcdc6b4302d340ac8c6f23f5fc 100644 (file)
@@ -178,7 +178,8 @@ trace_format(krb5_context context, const char *fmt, va_list ap)
         } else if (strcmp(tmpbuf, "kerr") == 0) {
             kerr = va_arg(ap, krb5_error_code);
             p = krb5_get_error_message(context, kerr);
-            krb5int_buf_add_fmt(&buf, "%ld/%s", (long) kerr, p);
+            krb5int_buf_add_fmt(&buf, "%ld/%s", (long) kerr,
+                                kerr ? p : "Success");
             krb5_free_error_message(context, p);
         } else if (strcmp(tmpbuf, "keyblock") == 0) {
             keyblock = va_arg(ap, const krb5_keyblock *);