diff options
author | yar <yar@FreeBSD.org> | 2006-11-26 20:08:40 +0000 |
---|---|---|
committer | yar <yar@FreeBSD.org> | 2006-11-26 20:08:40 +0000 |
commit | c8d29e02f49b2300c206bf46540e4a23dd867ade (patch) | |
tree | 70f4819c004fb39e9ff2c9312de1d55553c62eea /usr.bin/systat | |
parent | e0945d6033d465ed1357eefa99de907e043f1f1f (diff) | |
download | FreeBSD-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/systat')
-rw-r--r-- | usr.bin/systat/convtbl.c | 2 |
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]; |