You probably read about all the Microsoft Zunes that stopped working at midnight on New Year’s eve. Here is the code that caused them to break. Can you spot the bug? $10 Starbucks card to the first correct comment posted.
BOOL ConvertDays(UINT32 days, SYSTEMTIME* lpTime){ int dayofweek, month, year; UINT8 *month_tab;
//Calculate current day of the week dayofweek = GetDayOfWeek(days);
year = ORIGINYEAR;
while (days > 365) { if (IsLeapYear(year)) { if (days > 366) { days -= 366; year += 1; } } else { days -= 365; year += 1; } }








