diff options
author | /C=EU/ST=EU/CN=Pablo Neira Ayuso/emailAddress=pablo@netfilter.org </C=EU/ST=EU/CN=Pablo Neira Ayuso/emailAddress=pablo@netfilter.org> | 2008-01-05 12:34:45 +0000 |
---|---|---|
committer | /C=EU/ST=EU/CN=Pablo Neira Ayuso/emailAddress=pablo@netfilter.org </C=EU/ST=EU/CN=Pablo Neira Ayuso/emailAddress=pablo@netfilter.org> | 2008-01-05 12:34:45 +0000 |
commit | cf36ca8cc146f0bc2052f078e6aae3479822ca54 (patch) | |
tree | 08b3ad8224cce5759bd211cdf3ef5c8967286db1 /src/log.c | |
parent | b673b6766ddd63a10dc97c03b101ea53f80b51f2 (diff) | |
download | conntrack-tools-cf36ca8cc146f0bc2052f078e6aae3479822ca54.tar.gz conntrack-tools-cf36ca8cc146f0bc2052f078e6aae3479822ca54.zip |
Ben Lentz <BLentz@channing-bete.com>:
Fix the crash when stats LogFile is off and stats Syslog is on
-Esta línea y las que están debajo serán ignoradas--
M conntrack-tools/src/log.c
Diffstat (limited to 'src/log.c')
-rw-r--r-- | src/log.c | 11 |
1 files changed, 6 insertions, 5 deletions
@@ -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); } |