diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/utils.h | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/include/utils.h b/include/utils.h index 2f5cf34..3cc6596 100644 --- a/include/utils.h +++ b/include/utils.h @@ -50,14 +50,13 @@ void __nftnl_assert_attr_exists(uint16_t attr, uint16_t attr_max, __nftnl_assert_attr_exists(_attr, _attr_max, __FILE__, __LINE__); \ }) -#define SNPRINTF_BUFFER_SIZE(ret, size, len, offset) \ +#define SNPRINTF_BUFFER_SIZE(ret, remain, offset) \ if (ret < 0) \ ret = 0; \ offset += ret; \ - if (ret > len) \ - ret = len; \ - size += ret; \ - len -= ret; + if (ret > remain) \ + ret = remain; \ + remain -= ret; \ const char *nftnl_family2str(uint32_t family); int nftnl_str2family(const char *family); |