Fix check for XIGetProperty
authorrafspiny <rafspiny@gmail.com>
Sat, 28 Dec 2019 22:06:17 +0000 (22:06 +0000)
committerJongmin Lee <jm105.lee@samsung.com>
Sun, 29 Dec 2019 20:46:23 +0000 (05:46 +0900)
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

index 6bbbd85..c1b131e 100644 (file)
@@ -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;