From d8b2cf28b167acddf2edef63c6f896a1928d8b1c Mon Sep 17 00:00:00 2001 From: rafspiny Date: Sat, 28 Dec 2019 22:06:17 +0000 Subject: [PATCH] Fix check for XIGetProperty Summary: The function XIGetProperty returns 0 on success. More info on the function here: https://www.x.org/releases/X11R7.5/doc/man/man3/XIGetProperty.3.html Reviewers: raster, stefan_schmidt, bu5hm4n Reviewed By: raster Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D10978 --- src/lib/ecore_x/ecore_x_xi2.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/lib/ecore_x/ecore_x_xi2.c b/src/lib/ecore_x/ecore_x_xi2.c index 6bbbd855b6..c1b131e1c0 100644 --- a/src/lib/ecore_x/ecore_x_xi2.c +++ b/src/lib/ecore_x/ecore_x_xi2.c @@ -1035,9 +1035,10 @@ ecore_x_input_device_property_get(int slot, const char *prop, int *num_ret, if ((slot < 0) || (slot >= _ecore_x_xi2_num)) goto err; a = XInternAtom(_ecore_x_disp, prop, False); - if (!XIGetProperty(_ecore_x_disp, _ecore_x_xi2_devs[slot].deviceid, + // XIGetProperty returns 0 AKA `Success` if everything is good + if (XIGetProperty(_ecore_x_disp, _ecore_x_xi2_devs[slot].deviceid, a, 0, 65536, False, AnyPropertyType, &a_type, &fmt, - &num, &dummy, &data)) goto err; + &num, &dummy, &data) != 0) goto err; *format_ret = a_type; *num_ret = num; *unit_size_ret = fmt;