Enlightenment CVS committal

Author  : morlenxus
Project : e_modules
Module  : tclock

Dir     : e_modules/tclock


Modified Files:
        e_mod_main.c e_mod_config.c 


Log Message:
fix segfault

===================================================================
RCS file: /cvs/e/e_modules/tclock/e_mod_main.c,v
retrieving revision 1.46
retrieving revision 1.47
diff -u -3 -r1.46 -r1.47
--- e_mod_main.c        3 Feb 2007 06:10:51 -0000       1.46
+++ e_mod_main.c        26 Feb 2007 14:07:18 -0000      1.47
@@ -267,10 +267,16 @@
        
        memset (buf, 0, sizeof (buf));
        
-       strftime (buf, 1024, ci->time_format, local_time);
-       edje_object_part_text_set (inst->tclock, "tclock_time", buf);
-       strftime (buf, 1024, ci->date_format, local_time);
-       edje_object_part_text_set (inst->tclock, "tclock_date", buf);
+       if (ci->time_format)
+         {
+           strftime (buf, 1024, ci->time_format, local_time);
+           edje_object_part_text_set (inst->tclock, "tclock_time", buf);
+         }
+       if (ci->date_format)
+         {
+           strftime (buf, 1024, ci->date_format, local_time);
+           edje_object_part_text_set (inst->tclock, "tclock_date", buf);
+         }
      }
    
   return 1;
===================================================================
RCS file: /cvs/e/e_modules/tclock/e_mod_config.c,v
retrieving revision 1.30
retrieving revision 1.31
diff -u -3 -r1.30 -r1.31
--- e_mod_config.c      20 Jan 2007 04:45:19 -0000      1.30
+++ e_mod_config.c      26 Feb 2007 14:07:18 -0000      1.31
@@ -49,8 +49,10 @@
 {
   cfdata->show_time = ci->show_time;
   cfdata->show_date = ci->show_date;
-  cfdata->time_format = strdup (ci->time_format);
-  cfdata->date_format = strdup (ci->date_format);
+  if (ci->time_format)
+    cfdata->time_format = strdup (ci->time_format);
+  if (ci->date_format)
+    cfdata->date_format = strdup (ci->date_format);
 }
 
 static void *



-------------------------------------------------------------------------
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
[email protected]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to