summaryrefslogtreecommitdiffstats
path: root/src/expr.c
diff options
context:
space:
mode:
authorVarsha Rao <rvarsha016@gmail.com>2017-09-20 21:53:08 +0530
committerPablo Neira Ayuso <pablo@netfilter.org>2017-09-27 14:00:13 +0200
commit676ea569bbe5abf750d9ed516f35c017efbdce5f (patch)
treec348c3f834009ef5edb881311b20f26a46b40307 /src/expr.c
parentb808caea50a9de10530591b2e83c243d9fbf4855 (diff)
src: Change parameters of SNPRINTF_BUFFER_SIZE macro.
SNPRINTF_BUFFER_SIZE() macro declaration and definition is changed so that it accepts three arguments ret, remain and offset. Parameters size and len are not required instead parameter remain keeps track of available space in the buffer. Signed-off-by: Varsha Rao <rvarsha016@gmail.com>
Diffstat (limited to 'src/expr.c')
-rw-r--r--src/expr.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/expr.c b/src/expr.c
index 10ba2c4..a077cce 100644
--- a/src/expr.c
+++ b/src/expr.c
@@ -279,13 +279,13 @@ int nftnl_expr_snprintf(char *buf, size_t size, const struct nftnl_expr *expr,
uint32_t type, uint32_t flags)
{
int ret;
- unsigned int offset = 0, len = size;
+ unsigned int offset = 0, remain = size;
if (!expr->ops->snprintf)
return 0;
- ret = expr->ops->snprintf(buf+offset, len, type, flags, expr);
- SNPRINTF_BUFFER_SIZE(ret, size, len, offset);
+ ret = expr->ops->snprintf(buf + offset, remain, type, flags, expr);
+ SNPRINTF_BUFFER_SIZE(ret, remain, offset);
return offset;
}