From 16c6a13fb1fb557f539bd77a486c84e9bd89e0a5 Mon Sep 17 00:00:00 2001 From: Patrick Pelissier Date: Mon, 22 Apr 2024 23:41:23 +0200 Subject: [PATCH] Make string functions exception aware --- m-string.h | 1 + 1 file changed, 1 insertion(+) diff --git a/m-string.h b/m-string.h index 4231857f..9802d9d5 100644 --- a/m-string.h +++ b/m-string.h @@ -1433,6 +1433,7 @@ m_string_get_str(m_string_t v, const m_string_t v2, bool append) if (M_UNLIKELY (!isprint((unsigned char) c))) { targetSize += 3; m_str1ng_set_size(v, size); + M_IF_EXCEPTION(m_str1ng_get_cstr(v)[size] = 0); ptr = m_str1ng_fit2size(v, targetSize); int d1 = c & 0x07, d2 = (c>>3) & 0x07, d3 = (c>>6) & 0x07; ptr[size ++] = '\\';