From abe1a6193f8558e1a1ea42ba431d164c18b08a3f Mon Sep 17 00:00:00 2001 From: "/C=EU/ST=EU/CN=Pablo Neira Ayuso/emailAddress=pablo@netfilter.org" Date: Thu, 7 Jun 2007 16:53:56 +0000 Subject: nfct_snprintf now returns the number of bytes that would have been written, not just the number of bytes written. Emulate snprintf behaviour as in specified in C99 --- include/internal.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/internal.h b/include/internal.h index c512a85..5a13c11 100644 --- a/include/internal.h +++ b/include/internal.h @@ -158,10 +158,11 @@ static inline int test_bit(int nr, const u_int32_t *addr) return ((1UL << (nr & 31)) & (addr[nr >> 5])) != 0; } -#define BUFFER_SIZE(ret, size, len) \ +#define BUFFER_SIZE(ret, size, len, offset) \ + size += ret; \ if (ret > len) \ ret = len; \ - size += ret; \ + offset += ret; \ len -= ret; int __build_conntrack(struct nfnl_subsys_handle *ssh, struct nfnlhdr *req, size_t size, u_int16_t type, u_int16_t flags, const struct nf_conntrack *ct); -- cgit v1.2.3