localtime() does not return NULL

This commit is contained in:
Pierre Pronchery 2007-05-09 22:36:01 +00:00
parent c3f10f08f2
commit 22c02149f9

View File

@ -41,8 +41,8 @@ static int _who(Prefs * prefs)
printf(" %c", '?');
printf(" %-8s", u->ut_line);
t = u->ut_tv.tv_sec;
if((tm = localtime(&t)) == NULL || strftime(buf, sizeof(buf),
"%b %e %H:%M", tm) == 0)
tm = localtime(&t);
if(strftime(buf, sizeof(buf), "%b %e %H:%M", tm) == 0)
strcpy(buf, "n/a");
printf(" %s\n", buf);
}