chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
networkd: link - don't log errors when missing routes/addresses are dropped
[elogind.git]
/
src
/
shared
/
utf8.c
diff --git
a/src/shared/utf8.c
b/src/shared/utf8.c
index 0b524d8a9041eae0348382cdf47159f7c2f8d0b3..c559c13678d62b7cd275f05721febe73b5205924 100644
(file)
--- a/
src/shared/utf8.c
+++ b/
src/shared/utf8.c
@@
-136,7
+136,7
@@
int utf8_encoded_to_unichar(const char *str) {
return unichar;
}
return unichar;
}
-bool utf8_is_printable
(const char* str, size_t length
) {
+bool utf8_is_printable
_newline(const char* str, size_t length, bool newline
) {
const uint8_t *p;
assert(str);
const uint8_t *p;
assert(str);
@@
-145,7
+145,8
@@
bool utf8_is_printable(const char* str, size_t length) {
int encoded_len = utf8_encoded_valid_unichar((const char *)p);
int val = utf8_encoded_to_unichar((const char*)p);
int encoded_len = utf8_encoded_valid_unichar((const char *)p);
int val = utf8_encoded_to_unichar((const char*)p);
- if (encoded_len < 0 || val < 0 || is_unicode_control(val))
+ if (encoded_len < 0 || val < 0 || is_unicode_control(val) ||
+ (!newline && val == '\n'))
return false;
length -= encoded_len;
return false;
length -= encoded_len;