#349916 – Pastie

Zune Source Code FAIL

via #349916 – Pastie.

The offending function from the source code of Zune’s that caused the huge, epic Zune failure.

For those of you that don’t know how it managed to fail (myself included), see this Digg explanation for more:

Ouch.

For anyone who is wondering or just doesn’t want to figure it out, Dec. 31 qualified as being greater than day 365 (obviously, because it was day 366) but it got caught where the program says to look at (days > 365). The problem is that there was no code for what to do if the day *equals* 366, only if days is *greater* than 366. So, there was no way to break out of the (days > 365) loop until today (day 367) when the program would reset days to 1, thereby breaking the loop.

Whoops. It’s amazing what one bad “if” statement can do.

Heh. Amateur mistake, I know…