From c4010a5da61d97ab261bc0d1b04b200057887582 Mon Sep 17 00:00:00 2001 From: Seunghun Lee Date: Tue, 14 Jan 2014 18:48:16 +0900 Subject: [PATCH] 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 31e3578fc3..d219899d32 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 be9f7f44e0..a147c0d15c 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;