Skip to content

Commit

Permalink
Added usecs to -t time output.
Browse files Browse the repository at this point in the history
  • Loading branch information
Paul S. Ferrell committed Mar 13, 2013
1 parent cc88470 commit aed926f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion dns_parse.c
Original file line number Diff line number Diff line change
Expand Up @@ -346,10 +346,12 @@ void print_summary(ip_info * ip, transport_info * trns, dns_info * dns,
if (conf->PRETTY_DATE) {
struct tm *time;
size_t result;
char t_date[200];
const char * format = "%F %T";
time = localtime(&(header->ts.tv_sec));
result = strftime(date, 200, format, time);
result = strftime(t_date, 200, format, time);
if (result == 0) strncpy(date, "Date format error", 20);
sprintf(date, "%s.%06d", t_date, (int)header->ts.tv_usec);
} else
sprintf(date, "%d.%06d", (int)header->ts.tv_sec,
(int)header->ts.tv_usec);
Expand Down

0 comments on commit aed926f

Please sign in to comment.