From cf36ca8cc146f0bc2052f078e6aae3479822ca54 Mon Sep 17 00:00:00 2001 From: "/C=EU/ST=EU/CN=Pablo Neira Ayuso/emailAddress=pablo@netfilter.org" Date: Sat, 5 Jan 2008 12:34:45 +0000 Subject: =?UTF-8?q?Ben=20Lentz=20:=20Fix=20the?= =?UTF-8?q?=20crash=20when=20stats=20LogFile=20is=20off=20and=20stats=20Sy?= =?UTF-8?q?slog=20is=20on=20-Esta=20l=C3=ADnea=20y=20las=20que=20est=C3=A1?= =?UTF-8?q?n=20debajo=20ser=C3=A1n=20ignoradas--?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit M conntrack-tools/src/log.c --- src/log.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'src/log.c') diff --git a/src/log.c b/src/log.c index e3f2102..a4d51ec 100644 --- a/src/log.c +++ b/src/log.c @@ -99,13 +99,14 @@ void dlog_ct(FILE *fd, struct nf_conntrack *ct) time_t t; char buf[1024]; char *tmp; + + t = time(NULL); + ctime_r(&t, buf); + tmp = buf + strlen(buf); + buf[strlen(buf)-1]='\t'; + nfct_snprintf(buf+strlen(buf), 1024-strlen(buf), ct, 0, 0, 0); if (fd) { - t = time(NULL); - ctime_r(&t, buf); - tmp = buf + strlen(buf); - buf[strlen(buf)-1]='\t'; - nfct_snprintf(buf+strlen(buf), 1024-strlen(buf), ct, 0, 0, 0); fprintf(fd, "%s\n", buf); fflush(fd); } -- cgit v1.2.3