diff options
author | Pablo Neira Ayuso <pablo@netfilter.org> | 2013-05-15 16:38:30 +0200 |
---|---|---|
committer | Pablo Neira Ayuso <pablo@netfilter.org> | 2013-05-15 16:42:31 +0200 |
commit | ca99976f450afa0f7ec2f4320e863860990af61d (patch) | |
tree | 5336f266cc35d3e4d01c87c743c1580a29df59a1 | |
parent | 02fd8b1fef9caf1da74e4e0d5ef3c16b2e4d37d7 (diff) | |
download | conntrack-tools-ca99976f450afa0f7ec2f4320e863860990af61d.tar.gz conntrack-tools-ca99976f450afa0f7ec2f4320e863860990af61d.zip |
conntrack: fix timestamps when microseconds are less than 100000
The fractional portion of timestamps reported by conntrack
is printed as a left-justified integer instead of fixed-width
and zero-padded.
Closes netfilter's bugzilla 817:
https://bugzilla.netfilter.org/show_bug.cgi?id=817
Reported-by: hoffman@stanford.edu
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
-rw-r--r-- | src/conntrack.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/conntrack.c b/src/conntrack.c index 227c355..d4e79de 100644 --- a/src/conntrack.c +++ b/src/conntrack.c @@ -1141,7 +1141,7 @@ static int event_cb(enum nf_conntrack_msg_type type, if (!(output_mask & _O_XML)) { struct timeval tv; gettimeofday(&tv, NULL); - printf("[%-8ld.%-6ld]\t", tv.tv_sec, tv.tv_usec); + printf("[%-.8ld.%-.6ld]\t", tv.tv_sec, tv.tv_usec); } else op_flags |= NFCT_OF_TIME; } |