diff options
Diffstat (limited to 'include/utils.h')
-rw-r--r-- | include/utils.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/include/utils.h b/include/utils.h index d8867647..bb58ba42 100644 --- a/include/utils.h +++ b/include/utils.h @@ -83,6 +83,16 @@ (void) (&_max1 == &_max2); \ _max1 > _max2 ? _max1 : _max2; }) +#define SNPRINTF_BUFFER_SIZE(ret, size, len, offset) \ + if (ret < 0) \ + abort(); \ + offset += ret; \ + assert(ret < len); \ + if (ret > len) \ + ret = len; \ + size += ret; \ + len -= ret; + #define MSEC_PER_SEC 1000L /** |