seoz pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=c4010a5da61d97ab261bc0d1b04b200057887582
commit c4010a5da61d97ab261bc0d1b04b200057887582 Author: Seunghun Lee <[email protected]> Date: Tue Jan 14 18:48:16 2014 +0900 ecore ecore_x_e: check 0 and -1 for ecore_x_window_prop_window_get(). According to note for ecore_x_window_prop_window_get() : Summary: If the property was successfully fetched the number of items stored in val is returned, otherwise -1 is returned. Note: Return value 0 means that the property exists but has no elements. Reviewers: seoz Reviewed By: seoz CC: cedric Differential Revision: https://phab.enlightenment.org/D457 --- src/lib/ecore_x/xcb/ecore_xcb_e.c | 6 ++++-- src/lib/ecore_x/xlib/ecore_x_e.c | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/lib/ecore_x/xcb/ecore_xcb_e.c b/src/lib/ecore_x/xcb/ecore_xcb_e.c index 31e3578..d219899 100644 --- a/src/lib/ecore_x/xcb/ecore_xcb_e.c +++ b/src/lib/ecore_x/xcb/ecore_xcb_e.c @@ -1471,11 +1471,13 @@ EAPI Ecore_X_Window ecore_x_e_illume_zone_get(Ecore_X_Window win) { Ecore_X_Window zone = 0; + int ret; LOGFN(__FILE__, __LINE__, __FUNCTION__); - if (!ecore_x_window_prop_window_get(win, ECORE_X_ATOM_E_ILLUME_ZONE, - &zone, 1)) + ret = ecore_x_window_prop_window_get(win, ECORE_X_ATOM_E_ILLUME_ZONE, + &zone, 1); + if ((ret == 0) || (ret == -1)) return 0; return zone; diff --git a/src/lib/ecore_x/xlib/ecore_x_e.c b/src/lib/ecore_x/xlib/ecore_x_e.c index be9f7f4..a147c0d 100644 --- a/src/lib/ecore_x/xlib/ecore_x_e.c +++ b/src/lib/ecore_x/xlib/ecore_x_e.c @@ -256,10 +256,12 @@ EAPI Ecore_X_Window ecore_x_e_illume_zone_get(Ecore_X_Window win) { Ecore_X_Window zone = 0; + int ret; LOGFN(__FILE__, __LINE__, __FUNCTION__); - if (!ecore_x_window_prop_window_get(win, ECORE_X_ATOM_E_ILLUME_ZONE, - &zone, 1)) + ret = ecore_x_window_prop_window_get(win, ECORE_X_ATOM_E_ILLUME_ZONE, + &zone, 1); + if ((ret == 0) || (ret == -1)) return 0; return zone; --
