(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):
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);