summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Hall <halex@cvs.openbsd.org>2010-11-23 12:37:26 +0000
committerAlexander Hall <halex@cvs.openbsd.org>2010-11-23 12:37:26 +0000
commit35949d32559e07705cfb1ed0e69add34eb9e0453 (patch)
tree9a00fe0fdae8d2060771954b893485082794e122
parentc6f85bb74f903f411c28944b46568bd4a0920ee4 (diff)
do not print the terminating null character after strings
ok deraadt@
-rw-r--r--distrib/special/sysctl/sysctl.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/distrib/special/sysctl/sysctl.c b/distrib/special/sysctl/sysctl.c
index c622b690edd..1a705d3fbe5 100644
--- a/distrib/special/sysctl/sysctl.c
+++ b/distrib/special/sysctl/sysctl.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sysctl.c,v 1.6 2010/04/03 21:32:53 miod Exp $ */
+/* $OpenBSD: sysctl.c,v 1.7 2010/11/23 12:37:25 halex Exp $ */
/*
* Copyright (c) 2009 Theo de Raadt <deraadt@openbsd.org>
@@ -80,8 +80,7 @@ pstring(struct var *v)
if (sysctl(v->mib, v->nmib, p, &len, NULL, 0) != -1) {
if (nflag == 0)
printf("%s=", v->name);
- fwrite(p, len, 1, stdout);
- printf("\n");
+ printf("%s\n", p);
return (0);
}
return (1);