summaryrefslogtreecommitdiff
path: root/sysctl.c
diff options
context:
space:
mode:
authorSami Kerola <kerolasa@iki.fi>2012-03-02 12:41:23 +0100
committerCraig Small <csmall@enc.com.au>2012-03-03 18:40:58 +1100
commitf5e2277a2e5f9b9126c96321d15bb3697dff2879 (patch)
tree66ccfb0f2c5014b6408a46bcfb60123e3c6c19ee /sysctl.c
parent6dd921ca1cbac4e0e23bf5a2b6116a0f89c373ad (diff)
downloadprocps-ng-f5e2277a2e5f9b9126c96321d15bb3697dff2879.tar.gz
sysctl: print new line explicitely
In some cases sysctl does not print new line after the last line. This commit fixes that behavior. Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Diffstat (limited to 'sysctl.c')
-rw-r--r--sysctl.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/sysctl.c b/sysctl.c
index c27fe02..b6f6fc0 100644
--- a/sysctl.c
+++ b/sysctl.c
@@ -240,6 +240,8 @@ static int ReadSetting(const char *restrict const name)
if (PrintName) {
fprintf(stdout, "%s = %s",
outname, inbuf);
+ if (inbuf[strlen(inbuf) - 1] != '\n')
+ putchar('\n');
} else {
if (!PrintNewline) {
char *nlptr =