diff options
author | John MacFarlane <[email protected]> | 2019-03-17 23:03:54 -0600 |
---|---|---|
committer | GitHub <[email protected]> | 2019-03-17 23:03:54 -0600 |
commit | ca8ef74a8d50fbd76fb0d22fb110e660ef9944a4 (patch) | |
tree | b504be83b35eb6dc5847ad579c2164efa40ff5e7 /src/render.c | |
parent | b1e6af5a9347c0b21400a7e0aad00f5167b3e472 (diff) | |
parent | c24c432517c721b8cb8022b98d8cf734c68d2aee (diff) |
Merge pull request #254 from github/empty-input
Check for empty buffer when rendering
Diffstat (limited to 'src/render.c')
-rw-r--r-- | src/render.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/render.c b/src/render.c index dd65d3b..a73d6f8 100644 --- a/src/render.c +++ b/src/render.c @@ -172,7 +172,7 @@ char *cmark_render(cmark_node *root, int options, int width, } // ensure final newline - if (renderer.buffer->ptr[renderer.buffer->size - 1] != '\n') { + if (renderer.buffer->size == 0 || renderer.buffer->ptr[renderer.buffer->size - 1] != '\n') { cmark_strbuf_putc(renderer.buffer, '\n'); } |