btop/src/freebsd
Mitchell Dorrell 3c6929b025 Fix integer overflows in btop_collect.cpp
Correct data types in calls to std::accumulate(). The "bandwidth" deques
have type "long long", so the initial value of the accumulator (0) must
also be "long long" (i.e., "0ll") to prevent integer overflows. Also,
since since the bandwidth deques are (signed) "long long", the avg_speed
should presumably be a signed "long long" instead of an unsigned
"uint64_t". The previous behavior was for large bandwidth values to
overflow the accumulator, resulting in a negative total, which then was
cast to be a huge "uint64_t" value. As a consequence, the network graph
autoscaling was broken for large bandwidths.
2023-05-26 01:26:21 -04:00
..
btop_collect.cpp Fix integer overflows in btop_collect.cpp 2023-05-26 01:26:21 -04:00