summaryrefslogtreecommitdiff
path: root/src/dispnew.c
diff options
context:
space:
mode:
authorKim F. Storm <storm@cua.dk>2006-07-11 22:55:29 +0000
committerKim F. Storm <storm@cua.dk>2006-07-11 22:55:29 +0000
commit8e09f23fbf217926f2d1d1e2c71e393d9e74c891 (patch)
tree7053b293df2c0bad461b5d0bac686602a6912e13 /src/dispnew.c
parentbac4dbd166a05e22635cd1cc18ecb0c694ab2ce2 (diff)
downloademacs-8e09f23fbf217926f2d1d1e2c71e393d9e74c891.tar.gz
(sit_for): Signal error if TIMEOUT is not a number in case arg comes
directly from a Lisp variable.
Diffstat (limited to 'src/dispnew.c')
-rw-r--r--src/dispnew.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/src/dispnew.c b/src/dispnew.c
index 3519e2d64fe..018717e591f 100644
--- a/src/dispnew.c
+++ b/src/dispnew.c
@@ -6519,17 +6519,21 @@ sit_for (timeout, reading, do_display)
if (do_display >= 2)
redisplay_preserve_echo_area (2);
- if (FLOATP (timeout))
+ if (INTEGERP (timeout))
{
- double seconds = XFLOAT_DATA (timeout);
+ sec = XFASTINT (timeout);
+ usec = 0;
+ }
+ else if (FLOATP (timeout))
+ {
+ double seconds;
+
+ seconds = XFLOAT_DATA (timeout);
sec = (int) seconds;
usec = (int) ((seconds - sec) * 1000000);
}
else
- {
- sec = XFASTINT (timeout);
- usec = 0;
- }
+ wrong_type_argument (Qnumberp, timeout);
if (sec == 0 && usec == 0)
return Qt;