Enlightenment CVS committal

Author  : raster
Project : e17
Module  : libs/evas

Dir     : e17/libs/evas/src/lib/data


Modified Files:
        evas_list.c 


Log Message:


BAD tilman! what if the list is NULL! :)

===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/evas/src/lib/data/evas_list.c,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -3 -r1.8 -r1.9
--- evas_list.c 31 Jan 2005 17:44:30 -0000      1.8
+++ evas_list.c 1 Feb 2005 03:04:26 -0000       1.9
@@ -703,16 +703,14 @@
    Evas_List *l;
 
    /* check for non-existing nodes */
-   if (n < 0 || n > list->count - 1) return NULL;
+   if ((n < 0) || (n > list->count - 1) || (!list)) return NULL;
 
    /* if the node is in the 2nd half of the list, search from the end
     * else, search from the beginning.
     */
    if (n > list->count / 2)
      {
-       n = list->count - n - 1;
-
-       for (i = 0, l = list->last; l; l = l->prev, i++)
+       for (i = list->count - 1, l = list->last; l; l = l->prev, i--)
          {
             if (i == n) return l;
          }
@@ -724,7 +722,6 @@
             if (i == n) return l;
          }
      }
-
    return NULL;
 }
 




-------------------------------------------------------
This SF.Net email is sponsored by: IntelliVIEW -- Interactive Reporting
Tool for open source databases. Create drag-&-drop reports. Save time
by over 75%! Publish reports on the web. Export to DOC, XLS, RTF, etc.
Download a FREE copy at http://www.intelliview.com/go/osdn_nl
_______________________________________________
enlightenment-cvs mailing list
enlightenment-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to