summaryrefslogtreecommitdiff
path: root/libps/procstat.c
diff options
context:
space:
mode:
authorMiles Bader <miles@gnu.org>1996-05-12 20:27:19 +0000
committerMiles Bader <miles@gnu.org>1996-05-12 20:27:19 +0000
commitc3d8ddeb1ad965850fe030c4b2532d0d0103f843 (patch)
treec6d411a3f6165d842b89f7a6e8185bf3861cff77 /libps/procstat.c
parent75970e2496e44081007bbb21a8cf2c8ebd1153c7 (diff)
(get_thread_wait): Correctly advance WAIT.
Diffstat (limited to 'libps/procstat.c')
-rw-r--r--libps/procstat.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/libps/procstat.c b/libps/procstat.c
index 8060faf6..c8858dee 100644
--- a/libps/procstat.c
+++ b/libps/procstat.c
@@ -457,7 +457,11 @@ get_thread_wait (char *waits, size_t waits_len, unsigned n)
if (wait >= waits + waits_len)
wait = 0;
else
- wait = memchr (wait, '\0', wait + waits_len - waits);
+ {
+ wait = memchr (wait, '\0', waits_len - (wait - waits));
+ if (wait)
+ wait++;
+ }
return wait;
}