Problem: Not waiting for a character when the tick count overflows.
Solution: Subtract the unsigned numbers and cast to int. (Ken Takata)
if (msec > 0)
{
- /* If the specified wait time has passed, return. */
+ /* If the specified wait time has passed, return. Beware that
+ * GetTickCount() may wrap around (overflow). */
dwNow = GetTickCount();
- if (dwNow >= dwEndTime)
+ if ((int)(dwNow - dwEndTime) >= 0)
break;
}
if (msec != 0)
static int included_patches[] =
{ /* Add new patch number below this line */
+/**/
+ 22,
/**/
21,
/**/