From: Eli Zaretskii Date: Thu, 14 Dec 2000 15:12:58 +0000 (+0000) Subject: (Fmsdos_set_mouse_buttons): Signal an error if the X-Git-Tag: emacs-pretest-21.0.95~525 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=e7522695a57b3fa8bc212d6b46fe13a2ba11f001;p=emacs.git (Fmsdos_set_mouse_buttons): Signal an error if the argument is outside the range [2..3]. --- 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.") (nbuttons) Lisp_Object nbuttons; { + int n; + CHECK_NUMBER (nbuttons, 0); - mouse_setup_buttons (XINT (nbuttons)); + n = XINT (nbuttons); + if (n < 2 || n > 3) + Fsignal (Qargs_out_of_range, + Fcons (build_string ("only 2 or 3 mouse buttons are supported"), + Fcons (nbuttons, Qnil))); + mouse_setup_buttons (n); return Qnil; }