]> ncurses.scripts.mit.edu Git - ncurses.git/blobdiff - ncurses/base/lib_mouse.c
ncurses 6.2 - patch 20200523
[ncurses.git] / ncurses / base / lib_mouse.c
index 8705a39ae153d9c9c41889b92a2978e88e0488e0..887f1ab5cf8f146324fb772daf80261f6a7423e0 100644 (file)
@@ -85,7 +85,7 @@
 #define CUR SP_TERMTYPE
 #endif
 
-MODULE_ID("$Id: lib_mouse.c,v 1.186 2020/05/02 21:13:04 tom Exp $")
+MODULE_ID("$Id: lib_mouse.c,v 1.188 2020/05/23 23:35:35 tom Exp $")
 
 #include <tic.h>
 
@@ -963,16 +963,16 @@ static bool
 decode_X10_bstate(SCREEN *sp, MEVENT * eventp, unsigned intro)
 {
     bool result;
-    int button;
+    int button = 0;
     int wheel = (intro & 96) == 96;
 
     eventp->bstate = 0;
 
     if (intro >= 96) {
        if (intro >= 160) {
-           button = (intro - 152);     /* buttons 8-11 */
+           button = (int) (intro - 152);       /* buttons 8-11 */
        } else if (intro >= 96) {
-           button = (intro - 92);      /* buttons 4-7 */
+           button = (int) (intro - 92);        /* buttons 4-7 */
        }
     } else {
        button = (intro & 3);