* keyboard.c (make_lispy_event): Fix problem in integer overflow.
authorPaul Eggert <eggert@cs.ucla.edu>
Thu, 12 May 2011 19:37:40 +0000 (12:37 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Thu, 12 May 2011 19:37:40 +0000 (12:37 -0700)
commit8e55734abd164a7b170380ce0413d1d792429ce8
tree6a9177c5130c419c089ee64d06b231aefed44afa
parent6434756cc552458f871b66dbd28692c8de69633c
* keyboard.c (make_lispy_event): Fix problem in integer overflow.

Don't assume that the difference between two unsigned long values
can fit into an integer.  At this point, we know button_down_time
<= event->timestamp, so the difference must be nonnegative, so
there's no need to cast the result if double-click-time is
nonnegative, as it should be; check that it's nonnegative, just in
case.  This bug is triggered when events are more than 2**31 ms
apart (about 25 days).
src/ChangeLog
src/keyboard.c