Use libkadm string handling routines
authorPaul Park <pjpark@mit.edu>
Mon, 21 Aug 1995 21:18:03 +0000 (21:18 +0000)
committerPaul Park <pjpark@mit.edu>
Mon, 21 Aug 1995 21:18:03 +0000 (21:18 +0000)
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@6562 dc483132-0cff-0310-8789-dd5450dbe970

src/kadmin/ktutil/ChangeLog
src/kadmin/ktutil/ktutil.c

index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..a1e71e66bec2c531e26347ef65975965ddf34de0 100644 (file)
@@ -0,0 +1,5 @@
+
+Mon Aug 21 17:01:40 EDT 1995   Paul Park       (pjpark@mit.edu)
+       * ktutil.c - Remove English-specific date handling and let timestamp_
+               to_sfstring() handle the formatting of the timestamp string.
+
index ae886ba10088a92e007346fd1b801e279b7323d9..2e53decd8d014846d081f8a70a2c98fc2fb66bce 100644 (file)
@@ -26,6 +26,7 @@
 #include "k5-int.h"
 #include "ktutil.h"
 #include <com_err.h>
+#include "adm_proto.h"
 #include <ss/ss.h>
 #include <stdio.h>
 #ifdef HAS_STDLIB_H
@@ -36,9 +37,6 @@ extern ss_request_table ktutil_cmds;
 krb5_context kcontext;
 krb5_kt_list ktlist = NULL;
 
-static char *Month_names[] = { "Jan", "Feb", "Mar", "Apr", "May", "Jun",
-                              "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" };
-
 int main(argc, argv)
     int argc;
     char *argv[];
@@ -203,14 +201,17 @@ void ktutil_list(argc, argv)
        }
        printf("%4d %4d ", i, lp->entry->vno);
        if (show_time) {
+           char fmtbuf[18];
+           char fill;
+
            stime = localtime((time_t *)&lp->entry->timestamp);
-           printf("%2d-%s-%2d %02d:%02d:%02d ",
-                  stime->tm_mday,
-                  Month_names[stime->tm_mon],
-                  stime->tm_year,
-                  stime->tm_hour,
-                  stime->tm_min,
-                  stime->tm_sec);
+           fill = ' ';
+           if (!krb5_timestamp_to_sfstring((krb5_timestamp)lp->entry->
+                                               timestamp,
+                                           fmtbuf,
+                                           sizeof(fmtbuf),
+                                           &fill))
+               printf(fmtbuf);
        }
        printf("%40s", pname);
        if (show_keys) {