Enlightenment CVS committal

Author  : devilhorns
Project : e_modules
Module  : weather

Dir     : e_modules/weather


Modified Files:
        e_mod_main.c 


Log Message:
Add some extra traps to parse routine to avoid a segfault.
Changed function declaration to pass data as void pointer.

===================================================================
RCS file: /cvs/e/e_modules/weather/e_mod_main.c,v
retrieving revision 1.37
retrieving revision 1.38
diff -u -3 -r1.37 -r1.38
--- e_mod_main.c        6 Jun 2006 15:33:44 -0000       1.37
+++ e_mod_main.c        7 Jun 2006 22:39:15 -0000       1.38
@@ -61,7 +61,7 @@
 static int _weather_server_add(void *data, int type, void *event);
 static int _weather_server_del(void *data, int type, void *event);
 static int _weather_server_data(void *data, int type, void *event);
-static int _weather_parse(Instance *inst);
+static int _weather_parse(void *data);
 static void _weather_display_set(Instance *inst, int ok);
 
 /* Gadcon Functions */
@@ -516,11 +516,16 @@
 }
 
 static int
-_weather_parse(Instance *inst)
+_weather_parse(void *data)
 {
+   Instance *inst;
    char *needle, *ext;
    char location[256];
 
+   inst = data;
+   if (!inst) return 0;
+   if (inst->buffer == NULL) return 0;
+   
    needle = strstr(inst->buffer, "<title");
    if (!needle) goto error;
 




_______________________________________________
enlightenment-cvs mailing list
enlightenment-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to