From ca99976f450afa0f7ec2f4320e863860990af61d Mon Sep 17 00:00:00 2001 From: Pablo Neira Ayuso Date: Wed, 15 May 2013 16:38:30 +0200 Subject: 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 --- src/conntrack.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/conntrack.c') 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; } -- cgit v1.2.3