=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/systat/vmstat.c,v retrieving revision 1.38 retrieving revision 1.39 diff -c -r1.38 -r1.39 *** src/usr.bin/systat/vmstat.c 2003/02/28 21:29:07 1.38 --- src/usr.bin/systat/vmstat.c 2003/04/08 00:53:09 1.39 *************** *** 1,4 **** ! /* $OpenBSD: vmstat.c,v 1.38 2003/02/28 21:29:07 jason Exp $ */ /* $NetBSD: vmstat.c,v 1.5 1996/05/10 23:16:40 thorpej Exp $ */ /*- --- 1,4 ---- ! /* $OpenBSD: vmstat.c,v 1.39 2003/04/08 00:53:09 deraadt Exp $ */ /* $NetBSD: vmstat.c,v 1.5 1996/05/10 23:16:40 thorpej Exp $ */ /*- *************** *** 38,44 **** #if 0 static char sccsid[] = "@(#)vmstat.c 8.2 (Berkeley) 1/12/94"; #endif ! static char rcsid[] = "$OpenBSD: vmstat.c,v 1.38 2003/02/28 21:29:07 jason Exp $"; #endif /* not lint */ /* --- 38,44 ---- #if 0 static char sccsid[] = "@(#)vmstat.c 8.2 (Berkeley) 1/12/94"; #endif ! static char rcsid[] = "$OpenBSD: vmstat.c,v 1.39 2003/04/08 00:53:09 deraadt Exp $"; #endif /* not lint */ /* *************** *** 213,233 **** nintr++; KREAD(ihp, &ih, sizeof(ih)); KREAD(ih.ih_what, iname, 16); ! namelen += 1 + strlen(iname); ihp = ih.ih_next; } } intrloc = calloc(nintr, sizeof (long)); intrname = calloc(nintr, sizeof (char *)); cp = intrnamebuf = malloc(namelen); ! for (namelen = 0, i = 0, n = 0; i < 16; i++) { ihp = intrhand[i]; while (ihp) { KREAD(ihp, &ih, sizeof(ih)); KREAD(ih.ih_what, iname, 16); /* XXX strcpy is safe, sized & malloc'd buffer */ ! strcpy(intrname[n++] = intrnamebuf + namelen, iname); ! namelen += 1 + strlen(iname); ihp = ih.ih_next; } } --- 213,234 ---- nintr++; KREAD(ihp, &ih, sizeof(ih)); KREAD(ih.ih_what, iname, 16); ! namelen += strlen(iname) + 1; ihp = ih.ih_next; } } intrloc = calloc(nintr, sizeof (long)); intrname = calloc(nintr, sizeof (char *)); cp = intrnamebuf = malloc(namelen); ! for (i = 0, n = 0; i < 16; i++) { ihp = intrhand[i]; while (ihp) { KREAD(ihp, &ih, sizeof(ih)); KREAD(ih.ih_what, iname, 16); /* XXX strcpy is safe, sized & malloc'd buffer */ ! intrname[n++] = cp; ! strlcpy(cp, iname, intrnamebuf + namelen - cp); ! cp += strlen(iname) + 1; ihp = ih.ih_next; } }