summaryrefslogtreecommitdiff
path: root/src/shared/fileio.c
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2014-03-04 09:50:26 -0500
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2014-03-04 10:04:50 -0500
commitb5d742138f71e87312541a89aac5657015f50f48 (patch)
treefe311a3e7a1f401a13557684e83f919ba28c8268 /src/shared/fileio.c
parent6e18964d3a365567954fe10ddcfad74babdc427c (diff)
Do not print invalid UTF-8 in error messages
Inexplicably, 550a40ec ('core: do not print invalid utf-8 in error messages') only fixed two paths. Convert all of them now.
Diffstat (limited to 'src/shared/fileio.c')
-rw-r--r--src/shared/fileio.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/shared/fileio.c b/src/shared/fileio.c
index d5915673d..f10126954 100644
--- a/src/shared/fileio.c
+++ b/src/shared/fileio.c
@@ -598,15 +598,18 @@ static int load_env_file_push(const char *filename, unsigned line,
int r;
if (!utf8_is_valid(key)) {
+ _cleanup_free_ char *t = utf8_escape_invalid(key);
+
log_error("%s:%u: invalid UTF-8 for key '%s', ignoring.",
- filename, line, key);
+ filename, line, t);
return -EINVAL;
}
if (value && !utf8_is_valid(value)) {
- /* FIXME: filter UTF-8 */
+ _cleanup_free_ char *t = utf8_escape_invalid(value);
+
log_error("%s:%u: invalid UTF-8 value for key %s: '%s', ignoring.",
- filename, line, key, value);
+ filename, line, key, t);
return -EINVAL;
}