Skip to content

Commit 6e74b81

Browse files
committed
updated for version 7.4b.022
Problem: Not waiting for a character when the tick count overflows. Solution: Subtract the unsigned numbers and cast to int. (Ken Takata)
1 parent ff631f9 commit 6e74b81

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

src/os_win32.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1357,9 +1357,10 @@ WaitForChar(long msec)
13571357

13581358
if (msec > 0)
13591359
{
1360-
/* If the specified wait time has passed, return. */
1360+
/* If the specified wait time has passed, return. Beware that
1361+
* GetTickCount() may wrap around (overflow). */
13611362
dwNow = GetTickCount();
1362-
if (dwNow >= dwEndTime)
1363+
if ((int)(dwNow - dwEndTime) >= 0)
13631364
break;
13641365
}
13651366
if (msec != 0)

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -727,6 +727,8 @@ static char *(features[]) =
727727

728728
static int included_patches[] =
729729
{ /* Add new patch number below this line */
730+
/**/
731+
22,
730732
/**/
731733
21,
732734
/**/

0 commit comments

Comments
 (0)