aboutsummaryrefslogtreecommitdiff
path: root/src/rc/rc-logger.c
diff options
context:
space:
mode:
authorWilliam Hubbs <w.d.hubbs@gmail.com>2018-05-09 17:30:08 -0500
committerWilliam Hubbs <w.d.hubbs@gmail.com>2018-05-09 17:30:08 -0500
commit2b1392af2fe9e5dfc8eda2f19d896efdc41840bf (patch)
tree2bf8b8a6f395e2d3ac1c52b086cf9dd65f45c926 /src/rc/rc-logger.c
parenta3d0e293eebcb92564c473e61ca42724844fb279 (diff)
Logger: only log printable characters and newlines
X-Gentoo-Bug: 651412 X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=651412
Diffstat (limited to 'src/rc/rc-logger.c')
-rw-r--r--src/rc/rc-logger.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/rc/rc-logger.c b/src/rc/rc-logger.c
index 062ce3d9..1da3f59c 100644
--- a/src/rc/rc-logger.c
+++ b/src/rc/rc-logger.c
@@ -87,8 +87,9 @@ write_log(int logfd, const char *buffer, size_t bytes)
}
if (!in_escape) {
- if (write(logfd, p++, 1) == -1)
- eerror("write: %s", strerror(errno));
+ if (isprint((unsigned char) *p) || *p == '\n')
+ if (write(logfd, p++, 1) == -1)
+ eerror("write: %s", strerror(errno));
continue;
}