That is kind of what I was thinking that the problem might be related to Feb having only 28 calendar days.

Maybe the scan goes into a loop because of how the program handles the monthly day count.

It may not be exactly the same thing but along the same lines

Just a thought