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:
parent
b8701b5430
commit
661b2c1683
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=109671
@ -552,7 +552,7 @@ show_var(int *oid, int nlen)
|
|||||||
i = sysctl(oid, nlen, 0, &j, 0, 0);
|
i = sysctl(oid, nlen, 0, &j, 0, 0);
|
||||||
j += j; /* we want to be sure :-) */
|
j += j; /* we want to be sure :-) */
|
||||||
|
|
||||||
val = alloca(j);
|
val = alloca(j + 1);
|
||||||
len = j;
|
len = j;
|
||||||
i = sysctl(oid, nlen, val, &len, 0, 0);
|
i = sysctl(oid, nlen, val, &len, 0, 0);
|
||||||
if (i || !len)
|
if (i || !len)
|
||||||
|
Loading…
Reference in New Issue
Block a user