cvs commit: src/usr.bin/vmstat vmstat.c

Bruce Evans bde at zeta.org.au
Tue Dec 9 01:58:13 PST 2003


[Resending after bounce]

On Mon, 8 Dec 2003, Dag-Erling [iso-8859-1] Sm=F8rgrav wrote:

> Bruce Evans <bde at zeta.org.au> writes:
> >  =09for (i =3D 0; i < nintr; i++) {
> >  =09=09clen =3D strlen(tintrname);
> > +
> > +=09=09/* Work around bogus padding in new interrupt code. */
> > +=09=09while (clen > 0 && tintrname[clen - 1] =3D=3D ' ')
> > +=09=09=09clen--;
> > +
> >  =09=09if (clen > istrnamlen)
> >  =09=09=09istrnamlen =3D clen;
> >  =09=09tintrname +=3D clen + 1;
> >  =09}
>
> This is wrong.  You can't possibly have tested it.

Oops.  I tested it on several i386 kernels and it seemed to work.  It
may have worked accidentally because the longest string was near the
beginning.  I even avoided that bug in a related fix written previously
for systat.  Anyway, this is just a reminder to fix the kernel.

Bruce


More information about the cvs-src mailing list