From 568a1c8f9648e8a9985e3432f11440dfd5f0151e Mon Sep 17 00:00:00 2001 From: peter Date: Wed, 22 Jan 2003 00:34:22 +0000 Subject: Fix what I think is an off-by-one in certain worst-case scenarios caused by rev 1.45. (eg: the estimate being exactly half of the result.) --- sbin/sysctl/sysctl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'sbin') diff --git a/sbin/sysctl/sysctl.c b/sbin/sysctl/sysctl.c index 927e7a4..d843d84 100644 --- a/sbin/sysctl/sysctl.c +++ b/sbin/sysctl/sysctl.c @@ -552,7 +552,7 @@ show_var(int *oid, int nlen) i = sysctl(oid, nlen, 0, &j, 0, 0); j += j; /* we want to be sure :-) */ - val = alloca(j); + val = alloca(j + 1); len = j; i = sysctl(oid, nlen, val, &len, 0, 0); if (i || !len) -- cgit v1.1