From 3c95c890245cbd79c9f31c316e7334a8f9229f04 Mon Sep 17 00:00:00 2001 From: sanine Date: Sun, 2 Jan 2022 01:29:31 -0600 Subject: append null character to html buffer --- src/bindings.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/bindings.c b/src/bindings.c index 235e2df..eb9710c 100644 --- a/src/bindings.c +++ b/src/bindings.c @@ -58,6 +58,8 @@ int markdown(lua_State *L) if (data.ok == false) hs_throw_error(L, "encountered error (re)allocating html buffer memory!"); + data.buf[data.index] = 0; + lua_pushstring(L, data.buf); free(data.buf); -- cgit v1.2.1