]> git.eshelyaron.com Git - emacs.git/commitdiff
* lread.c (read_filtered_event): Use duration_to_sec_usec.
authorPaul Eggert <eggert@cs.ucla.edu>
Wed, 21 Sep 2011 20:20:36 +0000 (13:20 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Wed, 21 Sep 2011 20:20:36 +0000 (13:20 -0700)
src/ChangeLog
src/lread.c

index cc0918e60306f0de865286c92bb186d11a545f39..f67d1b72bf2e1dc1f21af3ba5906faaabfffffd2 100644 (file)
        (openp): Check for out-of-range argument to 'access'.
        (read1): Use int, not EMACS_INT, where int is wide enough.
        Don't assume fixnum fits into int.
+       (read_filtered_event): Use duration_to_sec_usec
+       to do proper overflow checking on durations.
        * macros.c (Fstart_kbd_macro): Use xpalloc to check for overflow
        in size calculation.
        (Fexecute_kbd_macro):
index 7b3e0df5e8aa0f1d7a80e368eaf9aa0ec86e17a4..e427688fdc7b7529ebde5cee439fa4859041238a 100644 (file)
@@ -608,8 +608,11 @@ read_filtered_event (int no_switch_frame, int ascii_required,
       int sec, usec;
       double duration = extract_float (seconds);
 
-      sec  = (int) duration;
-      usec = (duration - sec) * 1000000;
+      if (0 < duration)
+       duration_to_sec_usec (duration, &sec, &usec);
+      else
+       sec = usec = 0;
+
       EMACS_GET_TIME (end_time);
       EMACS_SET_SECS_USECS (wait_time, sec, usec);
       EMACS_ADD_TIME (end_time, end_time, wait_time);