summaryrefslogtreecommitdiff
path: root/loadbars.pl
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2011-08-07 12:08:48 +0000
committerPaul Buetow <paul@buetow.org>2011-08-07 12:08:48 +0000
commit5ea0b3af5779a09ebd42e5ff0594128f89b3774d (patch)
tree9e5464df17b09e079ddf2e411b2a43dc8a7e241a /loadbars.pl
parent76174985aabe0fb868e15259ab6ea33035ec3182 (diff)
tagged v0.2.0.1
Diffstat (limited to 'loadbars.pl')
-rwxr-xr-xloadbars.pl6
1 files changed, 3 insertions, 3 deletions
diff --git a/loadbars.pl b/loadbars.pl
index b0b0c17..5e06bb6 100755
--- a/loadbars.pl
+++ b/loadbars.pl
@@ -49,7 +49,7 @@ use threads::shared;
use constant {
DEPTH => 8,
- VERSION => 'loadbars v0.2.1-devel',
+ VERSION => 'loadbars v0.2.0.1',
COPYRIGHT => '2010-2011 (c) Paul Buetow <loadbars@mx.buetow.org>',
BLACK => SDL::Color->new(-r => 0x00, -g => 0x00, -b => 0x00),
BLUE => SDL::Color->new(-r => 0x00, -g => 0x00, -b => 0xff),
@@ -342,6 +342,7 @@ sub main_loop ($@) {
my %is_host_summary;
my $new_num_stats = keys %CPUSTATS;
+
if ($new_num_stats != $num_stats) {
%prev_stats = ();
%last_loads = ();
@@ -351,8 +352,7 @@ sub main_loop ($@) {
}
# Avoid division by null
- my $div = $num_stats - 1;
- my $width = $CONF{width} / ($div ? $div : 1);
+ my $width = $CONF{width} / ($num_stats ? $num_stats : 1);
my $barnum = -1;
for my $key (sort keys %CPUSTATS) {