summaryrefslogtreecommitdiffstats
path: root/usr.bin
diff options
context:
space:
mode:
authoryar <yar@FreeBSD.org>2006-11-26 20:08:40 +0000
committeryar <yar@FreeBSD.org>2006-11-26 20:08:40 +0000
commitc8d29e02f49b2300c206bf46540e4a23dd867ade (patch)
tree70f4819c004fb39e9ff2c9312de1d55553c62eea /usr.bin
parente0945d6033d465ed1357eefa99de907e043f1f1f (diff)
downloadFreeBSD-src-c8d29e02f49b2300c206bf46540e4a23dd867ade.zip
FreeBSD-src-c8d29e02f49b2300c206bf46540e4a23dd867ade.tar.gz
Don't overflow from the gigabyte scale to the bit scale if the
number to auto-scale is >= 1024 Gb. Could be triggered on arches where ifdata counters had 64 bits. Reported by: Miroslav Slavkov on -net MFC after: 3 days
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/systat/convtbl.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/usr.bin/systat/convtbl.c b/usr.bin/systat/convtbl.c
index 5643613..7fbcf3b 100644
--- a/usr.bin/systat/convtbl.c
+++ b/usr.bin/systat/convtbl.c
@@ -69,7 +69,7 @@ get_tbl_ptr(const u_long size, const u_int scale)
* index as the array index into the conversion table.
*/
for (tmp = size, idx = SC_KILOBYTE;
- tmp >= MEGA && idx <= SC_GIGABYTE;
+ tmp >= MEGA && idx < SC_GIGABYTE;
tmp >>= 10, idx++);
tbl_ptr = &convtbl[idx];
OpenPOWER on IntegriCloud