[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Bug#2079: wu-ftpd xferstats



Stephen Early wrote:
> Package: wu-ftpd
> Version: 2.4-14
> 
> xferstats has a bug that shows up when a summary period crosses a year
> boundary:
> 
> TOTALS FOR SUMMARY PERIOD Mon Jan  1 1996 TO Sun Dec 31 1995

The following patch should fix the problem:


--- xferstats.orig	Sun May 14 02:28:54 1995
+++ xferstats	Tue Jan  2 00:02:20 1996
@@ -284,8 +284,8 @@
 
    $date1  = substr($a, 11, 4) * 4800;
    $date2  = substr($b, 11, 4) * 4800;
-   $date1 += index("JanFebMarAprMayJunJulAugSepOctNovDec",substr($a, 4, 3))*400;
-   $date2 += index("JanFebMarAprMayJunJulAugSepOctNovDec",substr($b, 4, 3))*400;
+   $date1 += index("JanFebMarAprMayJunJulAugSepOctNovDec",substr($a, 4, 3)) / 3 * 400;
+   $date2 += index("JanFebMarAprMayJunJulAugSepOctNovDec",substr($b, 4, 3)) / 3 * 400;
    $date1 += substr($a, 8, 2);
    $date2 += substr($b, 8, 2);
    $date1 - $date2;



Thanks,

Peter

-- 
 Peter Tobias                                EMail:
 Fachhochschule Ostfriesland                 tobias@et-inf.fho-emden.de
 Fachbereich Elektrotechnik und Informatik   tobias@perseus.fho-emden.de
 Constantiaplatz 4, 26723 Emden, Germany


Reply to: