From ca64ce4ad8837131b5c227299a3ee5bf45c94530 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Wed, 21 Nov 2018 00:07:43 +0100 Subject: [PATCH] sysctl: when debug logging about sysctl changes, truncate trailing newline --- src/shared/sysctl-util.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/shared/sysctl-util.c b/src/shared/sysctl-util.c index 326652273c..480e6c38a1 100644 --- a/src/shared/sysctl-util.c +++ b/src/shared/sysctl-util.c @@ -44,7 +44,7 @@ int sysctl_write(const char *property, const char *value) { assert(property); assert(value); - log_debug("Setting '%s' to '%s'", property, value); + log_debug("Setting '%s' to '%.*s'.", property, (int) strcspn(value, NEWLINE), value); p = strjoina("/proc/sys/", property); fd = open(p, O_WRONLY|O_CLOEXEC);