]> git.ipfire.org Git - thirdparty/krb5.git/commitdiff
Delete timestamp_to_sfstring sprintf fallback
authorTom Yu <tlyu@mit.edu>
Fri, 21 Dec 2012 21:07:28 +0000 (16:07 -0500)
committerTom Yu <tlyu@mit.edu>
Sat, 22 Dec 2012 17:40:16 +0000 (12:40 -0500)
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)

src/lib/krb5/krb/str_conv.c

index 1ffd026761711f4327fb2aed8ead91da98c31028..e070c9187875a3f5d850c47ca365ce1a334c9db6 100644 (file)
@@ -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<buflen-1; i++)
             buffer[i] = *pad;