From 5861caf52a21db0e6d0d47b96422486226bde99e Mon Sep 17 00:00:00 2001 From: Adam Saponara Date: Thu, 8 Feb 2024 20:50:22 -0500 Subject: [PATCH] null-terminate output of `tb_utf8_unicode_to_char` --- termbox2.h | 1 + 1 file changed, 1 insertion(+) diff --git a/termbox2.h b/termbox2.h index a48e3d6..e11e318 100644 --- a/termbox2.h +++ b/termbox2.h @@ -1957,6 +1957,7 @@ int tb_utf8_unicode_to_char(char *out, uint32_t c) { c >>= 6; } out[0] = c | first; + out[len] = '\0'; return len; }