Mercurial > vim
changeset 5292:d5d6b78cff09 v7.4b.022
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)
author | Bram Moolenaar <bram@vim.org> |
---|---|
date | Sat, 10 Aug 2013 12:45:09 +0200 |
parents | 908959a56382 |
children | 40f4f573218c |
files | src/os_win32.c src/version.c |
diffstat | 2 files changed, 5 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/src/os_win32.c +++ b/src/os_win32.c @@ -1357,9 +1357,10 @@ WaitForChar(long msec) 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)