From 24f08a61e6456fb2bdf1382000a0b4b3bf910d45 Mon Sep 17 00:00:00 2001 From: Laurent Bercot Date: Thu, 17 Sep 2020 23:31:28 +0000 Subject: Add stralloc_readyplus_tuned, fix overflow on stralloc_readyplus --- src/include/skalibs/stralloc.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/include') diff --git a/src/include/skalibs/stralloc.h b/src/include/skalibs/stralloc.h index b5f89ca..9572251 100644 --- a/src/include/skalibs/stralloc.h +++ b/src/include/skalibs/stralloc.h @@ -18,8 +18,9 @@ struct stralloc_s extern stralloc const stralloc_zero ; extern int stralloc_ready_tuned (stralloc *, size_t, size_t, size_t, size_t) ; +extern int stralloc_readyplus_tuned (stralloc *, size_t, size_t, size_t, size_t) ; #define stralloc_ready(sa, n) stralloc_ready_tuned(sa, (n), 8, 1, 8) -#define stralloc_readyplus(sa, n) stralloc_ready(sa, (sa)->len + (n)) +#define stralloc_readyplus(sa, n) stralloc_readyplus_tuned(sa, (n), 8, 1, 8) extern void stralloc_free (stralloc *) ; extern int stralloc_shrink (stralloc *) ; extern int stralloc_copyb (stralloc *, char const *, size_t) ; -- cgit v1.2.3