From ea5f2d56933d04975ef34b85372a577ad433950f Mon Sep 17 00:00:00 2001 From: Alexander Pickering Date: Wed, 5 Dec 2018 18:30:47 -0500 Subject: Allow bstringify to accept a null size Allow bstringify (and therefore TMPL_render()) to accept NULL as the size. When NULL is passed as the size, the size of the resulting string is not stored anywhere. --- src/fbuf.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/fbuf.c b/src/fbuf.c index 69a3475..33a7d6e 100644 --- a/src/fbuf.c +++ b/src/fbuf.c @@ -115,7 +115,8 @@ char* bstringify(struct TMPL_buf* b, size_t* size){ b->head = single; b->tail = single; - *size = b->total_len; + if(size != NULL) + *size = b->total_len; return single->data; } -- cgit v1.2.3-70-g09d2