aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAlexander Pickering <alexandermpickering@gmail.com>2018-12-05 18:30:47 -0500
committerAlexander Pickering <alexandermpickering@gmail.com>2018-12-05 18:30:47 -0500
commitea5f2d56933d04975ef34b85372a577ad433950f (patch)
tree8a9c31029e4216f8229d11bade823ac214658119 /src
parent03d363a337eea7fce725efbd51f99449e06395ef (diff)
downloadlibctemplates-ea5f2d56933d04975ef34b85372a577ad433950f.tar.gz
libctemplates-ea5f2d56933d04975ef34b85372a577ad433950f.tar.bz2
libctemplates-ea5f2d56933d04975ef34b85372a577ad433950f.zip
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.
Diffstat (limited to 'src')
-rw-r--r--src/fbuf.c3
1 files changed, 2 insertions, 1 deletions
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;
}