summaryrefslogtreecommitdiff
path: root/usr.bin/top
diff options
context:
space:
mode:
Diffstat (limited to 'usr.bin/top')
-rw-r--r--usr.bin/top/machine.c6
-rw-r--r--usr.bin/top/utils.c6
2 files changed, 6 insertions, 6 deletions
diff --git a/usr.bin/top/machine.c b/usr.bin/top/machine.c
index e8cec6785a4..caae215481b 100644
--- a/usr.bin/top/machine.c
+++ b/usr.bin/top/machine.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: machine.c,v 1.45 2004/11/17 09:22:43 markus Exp $ */
+/* $OpenBSD: machine.c,v 1.46 2004/11/22 15:26:53 pat Exp $ */
/*-
* Copyright (c) 1994 Thorsten Lockert <tholo@sigmasoft.com>
@@ -308,7 +308,7 @@ get_process_info(struct system_info *si, struct process_select *sel,
int (*compare) (const void *, const void *))
{
int show_idle, show_system, show_uid, show_pid;
- int total_procs, active_procs, i;
+ int total_procs, active_procs;
struct kinfo_proc2 **prefp, *pp;
if ((pbase = getprocs(KERN_PROC_KTHREAD, 0, &nproc)) == NULL) {
@@ -336,7 +336,7 @@ get_process_info(struct system_info *si, struct process_select *sel,
active_procs = 0;
memset((char *) process_states, 0, sizeof(process_states));
prefp = pref;
- for (pp = pbase, i = 0; i < nproc; pp++, i++) {
+ for (pp = pbase; pp < &pbase[nproc]; pp++) {
/*
* Place pointers to each valid proc structure in pref[].
* Process slots that are actually in use have a non-zero
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;