diff --git a/src/x11_init.c b/src/x11_init.c index 436151753..944791995 100644 --- a/src/x11_init.c +++ b/src/x11_init.c @@ -879,7 +879,7 @@ static void initPenTablet(Display *display) _glfw.x11.xi.eraser_deviceid = 0; if (_glfw.x11.xi.available) - { + { int i, n; XIDeviceInfo *dev_info = XIQueryDevice(display, XIAllDevices, &n); diff --git a/src/x11_window.c b/src/x11_window.c index 8b131361c..389e51124 100644 --- a/src/x11_window.c +++ b/src/x11_window.c @@ -1218,13 +1218,10 @@ static void processEvent(XEvent *event) 0, 5, False, XIAnyPropertyType, &type, &format, &num_items, &bytes_after, - (unsigned char **)&data - ) != Success) - data = NULL; - - if (data && format == 32 && num_items > 4) + (unsigned char **)&data) == Success) { - _glfwInputPenTabletProximity(((unsigned int *)data)[4] != 0); + if (format == 32 && num_items > 4) + _glfwInputPenTabletProximity(((unsigned int *)data)[4] != 0); XFree(data); } }