INN commit: branches/2.5/frontends (cnfsstat.in)

INN Commit rra at isc.org
Sat Jun 5 08:48:45 UTC 2010


    Date: Saturday, June 5, 2010 @ 01:48:44
  Author: iulius
Revision: 9078

Fix the use of uninitialized values:  storage classes and ARGV.
oldart was not declared as a local variable and its value was
then wrongly reused.

Modified:
  branches/2.5/frontends/cnfsstat.in

-------------+
 cnfsstat.in |   13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)

Modified: cnfsstat.in
===================================================================
--- cnfsstat.in	2010-06-05 08:48:13 UTC (rev 9077)
+++ cnfsstat.in	2010-06-05 08:48:44 UTC (rev 9078)
@@ -105,7 +105,11 @@
 if ($oclass) {
     if ($class{$oclass}) {
 	if (!$header_printed) {
-	    ($gr, $cl, $min, $max) = split(/:/, $stor{$oclass});
+            if ($stor{$oclass}) {
+                ($gr, $cl, $min, $max) = split(/:/, $stor{$oclass});
+            } else {
+                ($gr, $cl, $min, $max) = ('', $oclass, 0, 0);
+            }
 	    if ($use_syslog) {
 		if ($min || $max) {
 		    $logline = sprintf("Class %s for groups matching \"%s\" article size min/max: %d/%d", $oclass, $gr, $min, $max);
@@ -125,7 +129,7 @@
 	
 	@buffers = split(/,/, $class{$oclass});
 	if (! @buffers) {
-	    print STDERR "No buffers in Class $main::ARGV[0] ...\n";
+	    print STDERR "No buffers in Class $oclass ...\n";
 	    next;
 	}
 	
@@ -137,7 +141,7 @@
 	    &print_cycbuff_head($buff{$b});
 	}
     } else {
-	print STDERR "Class $ARGV[1] not found ...\n";
+	print STDERR "Class $oclass not found ...\n";
     }
 } else { # Print all Classes
 
@@ -411,6 +415,7 @@
 
 sub get_cycbuff_info {
     my($buffpath) = $_[0];
+    my $oldart;
 
     my($CNFSMASIZ)=8;
     my($CNFSNASIZ)=16;
@@ -475,7 +480,7 @@
 		$oldart = &lookup_age ($1);
 		next unless $oldart;
 		
-		# Is the article newer than the last update?
+		# Is the article newer than the last update of the cycbuff?
 		if ($oldart >= $update) {
 		    $update = $oldart;
 		} elsif ($oldart < $update - 60) {




More information about the inn-committers mailing list