Enlightenment CVS committal

Author  : devilhorns
Project : e_modules
Module  : mail

Dir     : e_modules/mail


Modified Files:
        e_mod_main.c 


Log Message:
Fix potential segfault when setting mail text. Thanks boneyfrog :)

===================================================================
RCS file: /cvs/e/e_modules/mail/e_mod_main.c,v
retrieving revision 1.32
retrieving revision 1.33
diff -u -3 -r1.32 -r1.33
--- e_mod_main.c        17 Jul 2006 23:59:13 -0000      1.32
+++ e_mod_main.c        19 Jul 2006 17:07:02 -0000      1.33
@@ -590,16 +590,20 @@
   ci = _mail_config_item_get (inst->gcc->id);
   if (!ci)
     return;
-  for (l = ci->boxes; l; l = l->next)
-    {
-      Config_Box *cb;
-
-      cb = l->data;
-      if (!cb)
-       continue;
-      count += cb->num_new;
-    }
 
+   if (ci->boxes) 
+     {
+       for (l = ci->boxes; l; l = l->next)
+         {
+            Config_Box *cb;
+            
+            cb = l->data;
+            if (!cb)
+              continue;
+            count += cb->num_new;
+         }
+     }
+   
   if (count > 0)
     {
       snprintf (buf, sizeof (buf), "%d", count);
@@ -608,8 +612,8 @@
     }
   else
     {
-      edje_object_signal_emit (inst->mail->mail_obj, "no_mail", "");
-      edje_object_part_text_set (inst->mail->mail_obj, "new_label", "");
+       edje_object_part_text_set (inst->mail->mail_obj, "new_label", "");
+       edje_object_signal_emit (inst->mail->mail_obj, "no_mail", "");
     }
 }
 



-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
enlightenment-cvs mailing list
enlightenment-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to