Enlightenment CVS committal

Author  : tsauerbeck
Project : e17
Module  : libs/ecore

Dir     : e17/libs/ecore/src/lib/ecore_x


Modified Files:
        ecore_x_window_prop.c 


Log Message:
added some sanity checks to ecore_x_window_property_get
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ecore/src/lib/ecore_x/ecore_x_window_prop.c,v
retrieving revision 1.46
retrieving revision 1.47
diff -u -3 -r1.46 -r1.47
--- ecore_x_window_prop.c       22 Aug 2004 22:04:12 -0000      1.46
+++ ecore_x_window_prop.c       2 Sep 2004 18:22:19 -0000       1.47
@@ -52,7 +52,15 @@
    int ret, size_ret = 0;
    unsigned long num_ret = 0, bytes = 0, i;
    unsigned char *prop_ret = NULL;
-   
+
+   /* make sure these are initialized */
+   if (num) *num = 0;
+
+   if (data)
+         *data = NULL;
+   else /* we can't store the retrieved data, so just return */
+         return 0;
+
    if (!win) win = DefaultRootWindow(_ecore_x_disp);
 
    ret = XGetWindowProperty(_ecore_x_disp, win, property, 0, LONG_MAX,
@@ -60,14 +68,10 @@
                             &num_ret, &bytes, &prop_ret);
 
    if (ret != Success)
-     {
-       *data = NULL;
        return 0;
-     }
 
    if (size != size_ret || !num_ret) {
       XFree(prop_ret);
-         *data = NULL;
          return 0;
    }
 
@@ -91,7 +95,7 @@
 
    XFree(prop_ret);
 
-   *num = num_ret;
+   if (num) *num = num_ret;
    return 1;
 }
 




-------------------------------------------------------
This SF.Net email is sponsored by BEA Weblogic Workshop
FREE Java Enterprise J2EE developer tools!
Get your free copy of BEA WebLogic Workshop 8.1 today.
http://ads.osdn.com/?ad_id=5047&alloc_id=10808&op=click
_______________________________________________
enlightenment-cvs mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to