Commit 1ab7b8ac authored by Paul Eggert's avatar Paul Eggert

* lread.c (read_filtered_event): Use duration_to_sec_usec.

parent 3b11691a
......@@ -459,6 +459,8 @@
(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.
......@@ -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);
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);
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment