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 Wemm 2003-01-22 00:34:22 +00:00
parent b8701b5430
commit 661b2c1683
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=109671

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)