Earlier today, the sound of thousands of Zune owners crying out in terror made ripples across the blogosphere. The response from Microsoft is to wait until tomorrow and all will be well. You’re probably wondering, what kind of bug fixes itself?
Well, I’ve got the code here and it’s very simple, really; if you’ve taken an introductory programming class, you’ll see the error right away.
You can see the details here, but the important bit is that today, the day count is 366. As you can see, the leap year is accounted for, but int “days” is too big for the main while loop to end the “if (days > 366)” has no else condition. So the thing just keeps running and running… until 24 hours have passed and int day receives a new value. At least, I think that’s what happens (it’s been a while since CS101).