diff options
author | Florian Westphal <fw@strlen.de> | 2017-07-13 16:02:31 +0200 |
---|---|---|
committer | Florian Westphal <fw@strlen.de> | 2017-07-13 17:40:13 +0200 |
commit | 92b74b562551a34b210667b692689cf224521209 (patch) | |
tree | 2e936faacc549b491850f92398486e1c7baac9a8 | |
parent | 4311d0939bd20a11a7a4bfae7462a02c986fdaa0 (diff) |
exhtdr: pacify compiler warning
gcc 7.1.1 complains:
exthdr.c:41:31: warning: ā%dā directive output may be truncated writing between 1 and 8 bytes into a region of size 3 [-Wformat-truncation=]
snprintf(buf, sizeof buf, "%d", offset);
^~
This warning is incorrect, as offset is limited by tcp option ranges,
but gcc doesn't know this. Increase buffer to avoid the warning.
Signed-off-by: Florian Westphal <fw@strlen.de>
-rw-r--r-- | src/exthdr.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/exthdr.c b/src/exthdr.c index a678115b..a412025c 100644 --- a/src/exthdr.c +++ b/src/exthdr.c @@ -30,7 +30,7 @@ static void exthdr_expr_print(const struct expr *expr, struct output_ctx *octx) * multiplicator */ unsigned int offset = expr->exthdr.offset / 64; - char buf[3] = {0}; + char buf[9] = {0}; if (expr->exthdr.flags & NFT_EXTHDR_F_PRESENT) { printf("tcp option %s", expr->exthdr.desc->name); |