From 4a1ec4f5988899077782701237157ccb52bfe428 Mon Sep 17 00:00:00 2001 From: Jordi Sanfeliu Date: Fri, 17 Jan 2014 12:35:30 +0100 Subject: [PATCH] fixed messages of 'use of uninitialized values' in 'proc' graph on FreeBSD systems --- lib/proc.pm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/proc.pm b/lib/proc.pm index 2088cb6..ca0db03 100644 --- a/lib/proc.pm +++ b/lib/proc.pm @@ -180,7 +180,8 @@ sub proc_update { my @data = split(' ', ); close(IN); chomp($ncpu); - for($n = 0; $n < $proc->{max}; $n++) { + $ncpu = min($ncpu, $proc->{max}); + for($n = 0; $n < $ncpu; $n++) { $str = "cpu" . $n; $from = $n * 5; $to = $from + 4;