diff options
author | Daniel Gröber <dxld@darkboxed.org> | 2020-06-24 15:29:58 +0200 |
---|---|---|
committer | Pablo Neira Ayuso <pablo@netfilter.org> | 2020-07-01 12:52:38 +0200 |
commit | 16756ca4edb55cdd8c88f4e123ffa6b94501d050 (patch) | |
tree | 9eb67f7a5f7bb010e3ad745193a3b73270896b2c /src | |
parent | 37e19771bbe9ff5e0c5a0c2fedfa356dcbc40627 (diff) |
src: Fix nfexp_snprintf return value docs
The docs currently say "[...] Otherwise, 0 is returned." which is just
completely wrong. Just like nfct_snprintf the expected buffer size is
returned.
Signed-off-by: Daniel Gröber <dxld@darkboxed.org>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'src')
-rw-r--r-- | src/expect/api.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/expect/api.c b/src/expect/api.c index 33099d8..39cd092 100644 --- a/src/expect/api.c +++ b/src/expect/api.c @@ -795,8 +795,9 @@ int nfexp_catch(struct nfct_handle *h) * - NFEXP_O_LAYER: include layer 3 information in the output, this is * *only* required by NFEXP_O_DEFAULT. * - * On error, -1 is returned and errno is set appropiately. Otherwise, - * 0 is returned. + * On error, -1 is returned and errno is set appropiately. Otherwise the + * size of what _would_ be written is returned, even if the size of the + * buffer is insufficient. This behaviour is similar to snprintf. */ int nfexp_snprintf(char *buf, unsigned int size, |