summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPablo Neira Ayuso <pablo@netfilter.org>2008-11-28 00:45:03 +0100
committerPablo Neira Ayuso <pablo@netfilter.org>2008-11-28 00:45:03 +0100
commit43ba03341b176cb71502df0ac7b979447b98fad9 (patch)
treeeeea7c63db13e72f13e223494abb33845caa095a /src
parent35a22c2721d92c983dc130468ca48aaae46be299 (diff)
conntrack: remove hardcoded buffer size, use sizeof instead
This patch replaces a couple of hardcoded buffer sizes by sizeof() calls. This sort of code is error-prone. Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'src')
-rw-r--r--src/conntrack.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/conntrack.c b/src/conntrack.c
index 999df87..9d73631 100644
--- a/src/conntrack.c
+++ b/src/conntrack.c
@@ -759,7 +759,7 @@ static int delete_cb(enum nf_conntrack_msg_type type,
if (output_mask & _O_ID)
op_flags |= NFCT_OF_ID;
- nfct_snprintf(buf, 1024, ct, NFCT_T_UNKNOWN, op_type, op_flags);
+ nfct_snprintf(buf, sizeof(buf), ct, NFCT_T_UNKNOWN, op_type, op_flags);
printf("%s\n", buf);
counter++;
@@ -782,7 +782,7 @@ static int print_cb(enum nf_conntrack_msg_type type,
if (output_mask & _O_ID)
op_flags |= NFCT_OF_ID;
- nfct_snprintf(buf, 1024, ct, NFCT_T_UNKNOWN, op_type, op_flags);
+ nfct_snprintf(buf, sizeof(buf), ct, NFCT_T_UNKNOWN, op_type, op_flags);
printf("%s\n", buf);
return NFCT_CB_CONTINUE;
@@ -848,7 +848,7 @@ static int dump_exp_cb(enum nf_conntrack_msg_type type,
{
char buf[1024];
- nfexp_snprintf(buf, 1024, exp, NFCT_T_UNKNOWN, NFCT_O_DEFAULT, 0);
+ nfexp_snprintf(buf,sizeof(buf), exp, NFCT_T_UNKNOWN, NFCT_O_DEFAULT, 0);
printf("%s\n", buf);
counter++;