From: Tom Yu Date: Fri, 21 Dec 2012 21:07:28 +0000 (-0500) Subject: Delete timestamp_to_sfstring sprintf fallback X-Git-Tag: krb5-1.12-alpha1~379 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d26e137cac97399645f41b19270d565f5bd8192c;p=thirdparty%2Fkrb5.git Delete timestamp_to_sfstring sprintf fallback The final fallback for krb5_timestamp_to_sfstring() is an explicit European date-order format string passed to sprintf(). This can be confused with a conventional US date format. Because we attempt to build a strftime() replacement anyway, and we try passing some unambiguous ISO 8601 date and time formats to strftime(), remove this final fallback. ticket: 7518 (new) --- diff --git a/src/lib/krb5/krb/str_conv.c b/src/lib/krb5/krb/str_conv.c index 1ffd026761..e070c91878 100644 --- a/src/lib/krb5/krb/str_conv.c +++ b/src/lib/krb5/krb/str_conv.c @@ -259,15 +259,6 @@ krb5_timestamp_to_sfstring(krb5_timestamp timestamp, char *buffer, size_t buflen if ((ndone = strftime(buffer, buflen, sftime_format_table[i], tmp))) break; } - if (!ndone) { -#define sftime_default_len 2+1+2+1+4+1+2+1+2+1 - if (buflen >= sftime_default_len) { - snprintf(buffer, buflen, "%02d/%02d/%4d %02d:%02d", - tmp->tm_mday, tmp->tm_mon+1, 1900+tmp->tm_year, - tmp->tm_hour, tmp->tm_min); - ndone = strlen(buffer); - } - } if (ndone && pad) { for (i=ndone; i