From 0efbf6a4c7c137f558c4b3f7ee0b78fabe2461a2 Mon Sep 17 00:00:00 2001 From: Theodore Tso Date: Thu, 14 May 1998 04:38:14 +0000 Subject: [PATCH] Make sure the date string printed uses 4 digit years git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@10568 dc483132-0cff-0310-8789-dd5450dbe970 --- src/lib/krb5/krb/ChangeLog | 5 +++++ src/lib/krb5/krb/str_conv.c | 10 +++++----- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/src/lib/krb5/krb/ChangeLog b/src/lib/krb5/krb/ChangeLog index 9cc9d761c..bc7e1a507 100644 --- a/src/lib/krb5/krb/ChangeLog +++ b/src/lib/krb5/krb/ChangeLog @@ -1,3 +1,8 @@ +1998-05-12 Theodore Ts'o + + * str_conv.c (krb5_timestamp_to_sfstring): Make sure the date + string printed uses 4 digit years. + 1998-05-08 Theodore Ts'o * str_conv.c (krb5_string_to_timestamp, strptime): Fix routines to diff --git a/src/lib/krb5/krb/str_conv.c b/src/lib/krb5/krb/str_conv.c index c059f838e..6346aef23 100644 --- a/src/lib/krb5/krb/str_conv.c +++ b/src/lib/krb5/krb/str_conv.c @@ -156,12 +156,12 @@ static const char ascan_rel_col_hm[] = "%02d:%02d"; #endif /* !HAVE_STRPTIME */ #ifdef HAVE_STRFTIME static const char sftime_ldep_time[] = "%c"; -static const char sftime_med_fmt[] = "%d %b %y %T"; +static const char sftime_med_fmt[] = "%d %b %Y %T"; static const char sftime_short_fmt[] = "%x %X"; -static const char sftime_last_fmt[] = "%d/%m/%y %R"; +static const char sftime_last_fmt[] = "%d/%m/%Y %R"; #endif /* HAVE_STRFTIME */ -static const char sftime_default_fmt[] = "%02d/%02d/%02d %02d:%02d"; -static const size_t sftime_default_len = 2+1+2+1+2+1+2+1+2+1; +static const char sftime_default_fmt[] = "%02d/%02d/%4d %02d:%02d"; +static const size_t sftime_default_len = 2+1+2+1+4+1+2+1+2+1; /* Delta time strings */ static const char dtscan_dhms_notext[] = "%d-%02d:%02d:%02d"; @@ -674,7 +674,7 @@ krb5_timestamp_to_sfstring(timestamp, buffer, buflen, pad) if (!ndone) { if (buflen >= sftime_default_len) { sprintf(buffer, sftime_default_fmt, - tmp->tm_mday, tmp->tm_mon+1, tmp->tm_year, + tmp->tm_mday, tmp->tm_mon+1, 1900+tmp->tm_year, tmp->tm_hour, tmp->tm_min, tmp->tm_sec); ndone = strlen(buffer); } -- 2.26.2