mirror of
https://github.com/opnsense/src.git
synced 2026-05-28 04:12:45 -04:00
sysctl: emit a newline after NULL node descriptions
Previously when printing the sysctl description (via the -d flag) we omitted the newline if the node provided no description (i.e., NULL). This could be observed via e.g. `sysctl -d dev`. PR: 44034 Reviewed by: zlei Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D42112 (cherry picked from commit 75be7e30271bb192fd27698982f2c7e56831eeef)
This commit is contained in:
parent
2fe06dda0a
commit
ced9fe051e
1 changed files with 3 additions and 1 deletions
|
|
@ -998,8 +998,10 @@ show_info(char *name, const char *sep, int ctltype, char *fmt, int *qoid, int nl
|
|||
bzero(buf, BUFSIZ);
|
||||
j = sizeof(buf);
|
||||
i = sysctl(qoid, nlen + 2, buf, &j, 0, 0);
|
||||
if (i < 0)
|
||||
if (i < 0) {
|
||||
putchar('\n');
|
||||
return (1);
|
||||
}
|
||||
fputs(buf, stdout);
|
||||
return (error);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue