diff options
Diffstat (limited to 'usr.bin')
-rw-r--r-- | usr.bin/top/utils.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/usr.bin/top/utils.c b/usr.bin/top/utils.c index edd111c659c..317124c5700 100644 --- a/usr.bin/top/utils.c +++ b/usr.bin/top/utils.c @@ -1,4 +1,4 @@ -/* $OpenBSD: utils.c,v 1.18 2007/04/04 19:22:46 otto Exp $ */ +/* $OpenBSD: utils.c,v 1.19 2007/07/16 15:14:33 otto Exp $ */ /* * Top users/processes display for Unix @@ -38,6 +38,7 @@ #include <stdio.h> #include <string.h> #include <stdlib.h> +#include <stdint.h> #include "top.h" #include "machine.h" @@ -226,7 +227,7 @@ percentages(int cnt, int64_t *out, int64_t *new, int64_t *old, int64_t *diffs) for (i = 0; i < cnt; i++) { if ((change = *new - *old) < 0) { /* this only happens when the counter wraps */ - change = (*new - *old); + change = INT64_MAX - *old + *new; } total_change += (*dp++ = change); *old++ = *new++; |