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.)
This commit is contained in:
peter 2003-01-22 00:34:22 +00:00
parent aecb199acf
commit 568a1c8f96

View File

@ -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)