From f410a5e391deccc10838b363955fe823a336bc82 Mon Sep 17 00:00:00 2001 From: Jari Vetoniemi Date: Mon, 14 Apr 2014 18:10:01 +0300 Subject: Make sure the text is null terminated. --- lib/util.c | 1 + 1 file changed, 1 insertion(+) (limited to 'lib/util.c') diff --git a/lib/util.c b/lib/util.c index 539afa2..2ace7f7 100644 --- a/lib/util.c +++ b/lib/util.c @@ -279,6 +279,7 @@ size_t _bmUtf8RuneInsert(char **inOutString, size_t *inOutBufSize, size_t start, char *str = *inOutString + start; memmove(str + u8len, str, len - start); memcpy(str, rune, u8len); + (*inOutString)[len + u8len] = 0; if (outRuneWidth) *outRuneWidth = _bmUtf8RuneWidth(rune, u8len); -- cgit v1.2.3-70-g09d2