Division by zero in innreport

Russ Allbery rra at stanford.edu
Thu Jan 5 01:42:38 UTC 2012


Julien ÉLIE <julien at trigofacile.com> writes:

> There is an issue in how innreport translates these dates.  The
> ConvDate() function assumes the dates are relative to the *current*
> year.  So it thinks it has been passed Dec 31th 2012 and Jan 1st 2012
> (whereas it was Dec 31th 2010 and Jan 1st 2011).  As 2012 is a leap
> year, and Dec 31th is after Feb 28th, the translated date contains an
> unexpected "+1 day".

This bug has been around for a long time.  I think it may even be in Trac
or TODO or somewhere, since I recall trying to fix it once and then
getting too confused by the date parsing code and giving up.

-- 
Russ Allbery (rra at stanford.edu)             <http://www.eyrie.org/~eagle/>

    Please send questions to the list rather than mailing me directly.
     <http://www.eyrie.org/~eagle/faqs/questions.html> explains why.



More information about the inn-workers mailing list