From dbfd2eba6427893cb48587d914719402252855b2 Mon Sep 17 00:00:00 2001 From: Nick Wellnhofer Date: Sun, 7 Jun 2015 14:04:20 +0200 Subject: Remove useless code in cmark_strbuf_grow cmark_strbuf_grow will never truncate a buffer. --- src/buffer.c | 5 ----- 1 file changed, 5 deletions(-) (limited to 'src') diff --git a/src/buffer.c b/src/buffer.c index d39828e..f74c8c6 100644 --- a/src/buffer.c +++ b/src/buffer.c @@ -82,11 +82,6 @@ void cmark_strbuf_grow(cmark_strbuf *buf, bufsize_t target_size) buf->asize = (bufsize_t)new_size; buf->ptr = new_ptr; - - /* truncate the existing buffer size if necessary */ - if (buf->size >= buf->asize) - buf->size = buf->asize - 1; - buf->ptr[buf->size] = '\0'; } size_t cmark_strbuf_len(const cmark_strbuf *buf) -- cgit v1.2.3