projects
/
platform
/
upstream
/
systemd.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
e3b4efd
)
basic/utf8: reduce memory usage
author
Zbigniew Jędrzejewski-Szmek
<zbyszek@in.waw.pl>
Wed, 22 May 2019 08:20:52 +0000
(10:20 +0200)
committer
Zbigniew Jędrzejewski-Szmek
<zbyszek@in.waw.pl>
Wed, 22 May 2019 08:22:20 +0000
(10:22 +0200)
src/basic/utf8.c
patch
|
blob
|
history
diff --git
a/src/basic/utf8.c
b/src/basic/utf8.c
index
e128769
..
afc2470
100644
(file)
--- 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;
}