fixed bug reported by Konstantin Klett via mail

This commit is contained in:
Anselm R. Garbe 2006-04-12 11:29:05 +02:00
parent 5662a1b15c
commit d2aba5b621
1 changed files with 2 additions and 1 deletions

View File

@ -124,7 +124,8 @@ static char *
time2str(unsigned int t)
{
static char buf[32];
cext_strlcpy(buf, ctime((time_t *)&t), sizeof(buf));
char *tstr = ctime((time_t *)&t);
cext_strlcpy(buf, tstr ? tstr : "invalid", sizeof(buf));
buf[strlen(buf) - 1] = 0;
return buf;
}