summaryrefslogtreecommitdiff
path: root/usr.bin/top/utils.c
diff options
context:
space:
mode:
Diffstat (limited to 'usr.bin/top/utils.c')
-rw-r--r--usr.bin/top/utils.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/usr.bin/top/utils.c b/usr.bin/top/utils.c
index adae8630f56..17cf3576243 100644
--- a/usr.bin/top/utils.c
+++ b/usr.bin/top/utils.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: utils.c,v 1.14 2004/10/07 06:26:12 otto Exp $ */
+/* $OpenBSD: utils.c,v 1.15 2004/11/22 15:26:53 pat Exp $ */
/*
* Top users/processes display for Unix
@@ -335,12 +335,12 @@ int
find_pid(pid_t pid)
{
struct kinfo_proc2 *pbase, *cur;
- int i, nproc;
+ int nproc;
if ((pbase = getprocs(KERN_PROC_KTHREAD, 0, &nproc)) == NULL)
quit(23);
- for (i = 0, cur = pbase; i < nproc; i++, cur++)
+ for (cur = pbase; cur < &pbase[nproc]; cur++)
if (cur->p_pid == pid)
return 1;
return 0;