From 4c6d51390c66ccbf647c2943657e8bb693312f38 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Wed, 22 May 2019 10:20:52 +0200 Subject: [PATCH] basic/utf8: reduce memory usage --- src/basic/utf8.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/basic/utf8.c b/src/basic/utf8.c index e12876962d6..afc24700dd7 100644 --- a/src/basic/utf8.c +++ b/src/basic/utf8.c @@ -32,6 +32,7 @@ #include "gunicode.h" #include "hexdecoct.h" #include "macro.h" +#include "string-util.h" #include "utf8.h" bool unichar_is_valid(char32_t ch) { @@ -192,7 +193,7 @@ char *utf8_escape_invalid(const char *str) { } *s = '\0'; - + (void) str_realloc(&p); return p; } @@ -278,6 +279,7 @@ char *utf8_escape_non_printable_full(const char *str, size_t console_width) { finish: *s = '\0'; + (void) str_realloc(&p); return p; } -- 2.39.2