InterNetNews / inn

INN (InterNetNews) Usenet server
https://www.isc.org/othersoftware/#INN
Other
72 stars 13 forks source link

innreport failure when archive is false #247

Open Julien-Elie opened 2 years ago

Julien-Elie commented 2 years ago

When archive is false in innreport.conf, an illegal division by zero is reported:

    $image->string(
        gdSmallFont(), $xmax / 2, $y_in,
        (sprintf "Avg: %5.1f $unit", $s_in / $t_in * $factor), $black
    );

$t_in equals 0 when there isn't any date in the first field of innreport.db:

news-notice.html|Jan 5 03:00:02 -- Jan 6 03:00:02|407991|31972|69.0 MB|632353|44546|539.2 MB

The expected name is something like news-notice.2022.01.02-04.15.02.html but that is not always true, whence a wrong computation here:

                my ($year) = $k =~ m/^news-notice\.
                       (\d+)\.\d+\.\d+-\d+.\d+.\d+$HTML_EXTENSION/x;
                $dates{$start_sec} = $end_sec;