Properly convert long to time_t
This commit is contained in:
parent
e8627df69d
commit
9ef76b94a7
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=85637
@ -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);
|
||||
}
|
||||
|
@ -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 {
|
||||
|
Loading…
Reference in New Issue
Block a user