diff options
| author | Eli Zaretskii | 2000-12-14 15:12:58 +0000 |
|---|---|---|
| committer | Eli Zaretskii | 2000-12-14 15:12:58 +0000 |
| commit | e7522695a57b3fa8bc212d6b46fe13a2ba11f001 (patch) | |
| tree | f185d50d34f78480bc388811e16f65001a854a00 | |
| parent | eccd9c9b8cc9af4bf7ab0cb8857c6c13bc6507a2 (diff) | |
| download | emacs-e7522695a57b3fa8bc212d6b46fe13a2ba11f001.tar.gz emacs-e7522695a57b3fa8bc212d6b46fe13a2ba11f001.zip | |
(Fmsdos_set_mouse_buttons): Signal an error if the
argument is outside the range [2..3].
| -rw-r--r-- | src/msdos.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/msdos.c b/src/msdos.c index 85ff6dd94a6..1c4e8409ed8 100644 --- a/src/msdos.c +++ b/src/msdos.c | |||
| @@ -195,8 +195,15 @@ them. This happens with wheeled mice on Windows 9X, for example.") | |||
| 195 | (nbuttons) | 195 | (nbuttons) |
| 196 | Lisp_Object nbuttons; | 196 | Lisp_Object nbuttons; |
| 197 | { | 197 | { |
| 198 | int n; | ||
| 199 | |||
| 198 | CHECK_NUMBER (nbuttons, 0); | 200 | CHECK_NUMBER (nbuttons, 0); |
| 199 | mouse_setup_buttons (XINT (nbuttons)); | 201 | n = XINT (nbuttons); |
| 202 | if (n < 2 || n > 3) | ||
| 203 | Fsignal (Qargs_out_of_range, | ||
| 204 | Fcons (build_string ("only 2 or 3 mouse buttons are supported"), | ||
| 205 | Fcons (nbuttons, Qnil))); | ||
| 206 | mouse_setup_buttons (n); | ||
| 200 | return Qnil; | 207 | return Qnil; |
| 201 | } | 208 | } |
| 202 | 209 | ||