Properly convert long to time_t

This commit is contained in:
Matthew Dillon 2001-10-28 20:19:14 +00:00
parent e8627df69d
commit 9ef76b94a7
2 changed files with 4 additions and 2 deletions

View File

@ -207,8 +207,9 @@ show_ip6fw(struct ip6_fw *chain)
if (chain->timestamp)
{
char timestr[30];
time_t t = long_to_time(chain->timestamp);
strcpy(timestr, ctime((time_t *)&chain->timestamp));
strcpy(timestr, ctime(&t));
*strchr(timestr, '\n') = '\0';
printf("%s ", timestr);
}

View File

@ -202,8 +202,9 @@ show_ipfw(struct ip_fw *chain)
if (do_time) {
if (chain->timestamp) {
char timestr[30];
time_t t = long_to_time(chain->timestamp);
strcpy(timestr, ctime((time_t *)&chain->timestamp));
strcpy(timestr, ctime(&t));
*strchr(timestr, '\n') = '\0';
printf("%s ", timestr);
} else {