summaryrefslogtreecommitdiff
path: root/src/shared
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2013-11-07 03:07:37 +0100
committerLennart Poettering <lennart@poettering.net>2013-11-07 03:07:40 +0100
commitfaaa5728d956b7f0d24f27f3341d0b9fff30af00 (patch)
tree16372665c06f8f22d70118f14cc303c63e448446 /src/shared
parent23c62e05b3954350495bf63b45fb5d846c2030a0 (diff)
utf8: export utf8 validation functions as part of sd-bus
To write useful bus code clients need to validate utf8 frequently since the bus reacts allergic to it. Since glibc does not provide any calls for this, let's provide it as part of libsystemd-bus.
Diffstat (limited to 'src/shared')
-rw-r--r--src/shared/utf8.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/shared/utf8.c b/src/shared/utf8.c
index aedf6e29ea..6e5ba9abf4 100644
--- a/src/shared/utf8.c
+++ b/src/shared/utf8.c
@@ -161,7 +161,9 @@ const char *utf8_is_valid(const char *str) {
assert(str);
for (p = (const uint8_t*) str; *p; ) {
- int len = utf8_encoded_valid_unichar((const char *)p);
+ int len;
+
+ len = utf8_encoded_valid_unichar((const char *)p);
if (len < 0)
return NULL;