Module Name: src
Committed By: christos
Date: Fri Apr 2 15:23:18 UTC 2010
Modified Files:
src/crypto/dist/heimdal/kuser: klist.c
Log Message:
handle ctime returning NULL.
To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/crypto/dist/heimdal/kuser/klist.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/crypto/dist/heimdal/kuser/klist.c
diff -u src/crypto/dist/heimdal/kuser/klist.c:1.9 src/crypto/dist/heimdal/kuser/klist.c:1.10
--- src/crypto/dist/heimdal/kuser/klist.c:1.9 Sat Mar 22 04:37:03 2008
+++ src/crypto/dist/heimdal/kuser/klist.c Fri Apr 2 11:23:17 2010
@@ -35,24 +35,32 @@
#include "rtbl.h"
__RCSID("$Heimdal: klist.c 20516 2007-04-22 10:40:41Z lha $"
- "$NetBSD: klist.c,v 1.9 2008/03/22 08:37:03 mlelstv Exp $");
+ "$NetBSD: klist.c,v 1.10 2010/04/02 15:23:17 christos Exp $");
static char*
-printable_time(time_t t)
+printable_time_internal(time_t t, int x)
{
static char s[128];
- strlcpy(s, ctime(&t)+ 4, sizeof(s));
- s[15] = 0;
+ char *p = ctime(&t);
+ if (p == NULL)
+ strlcpy(s, "?", sizeof(s));
+ else {
+ strlcpy(s, p + 4, sizeof(s));
+ s[x] = 0;
+ }
return s;
}
static char*
+printable_time(time_t t)
+{
+ return printable_time_internal(t, 15);
+}
+
+static char*
printable_time_long(time_t t)
{
- static char s[128];
- strlcpy(s, ctime(&t)+ 4, sizeof(s));
- s[20] = 0;
- return s;
+ return printable_time_internal(t, 20);
}
#define COL_ISSUED " Issued"