[elm_clock.c][elm_diskselector.c]prevent warnings are fixed. CID:55299,40070.
authorsumanth <sumanth.m@samsung.com>
Fri, 2 Dec 2011 06:49:48 +0000 (12:19 +0530)
committersumanth <sumanth.m@samsung.com>
Fri, 2 Dec 2011 06:49:48 +0000 (12:19 +0530)
Change-Id: I4d6f046cdd0a57c233ca4cd6548a7d7e98950498

src/lib/elm_clock.c
src/lib/elm_diskselector.c

index ad8565b..8594134 100644 (file)
@@ -142,9 +142,12 @@ _timediff_set(Widget_Data *wd)
    gettimeofday(&timev, NULL);
    tt = (time_t)(timev.tv_sec);
    tzset();
-   tm = localtime(&tt);
+   tm = calloc(1, sizeof(struct tm));
+   if (!tm) return;
+   localtime_r(&tt, tm);
    wd->timediff = (((wd->hrs - tm->tm_hour) * 60 +
                     wd->min - tm->tm_min) * 60) + wd->sec - tm->tm_sec;
+   free(tm);
 }
 
 static Eina_Bool
@@ -163,14 +166,15 @@ _ticker(void *data)
      {
         tt = (time_t)(timev.tv_sec) + wd->timediff;
         tzset();
-        tm = localtime(&tt);
-        if (tm)
-          {
-             wd->hrs = tm->tm_hour;
-             wd->min = tm->tm_min;
-             wd->sec = tm->tm_sec;
-             _time_update(data);
-          }
+        tm = calloc(1, sizeof(struct tm));
+        if (!tm) return ECORE_CALLBACK_CANCEL;
+        localtime_r(&tt, tm);
+        wd->hrs = tm->tm_hour;
+        wd->min = tm->tm_min;
+        wd->sec = tm->tm_sec;
+        _time_update(data);
+
+        free(tm);
      }
    return ECORE_CALLBACK_CANCEL;
 }
index cba3012..88e6165 100644 (file)
@@ -231,7 +231,7 @@ _del_pre_hook(Evas_Object * obj)
         if (it)
           {
              eina_stringshare_del(it->label);
-             evas_object_del(VIEW(wd->first));
+             evas_object_del(VIEW(it));
              free(it);
           }
      }
@@ -241,7 +241,7 @@ _del_pre_hook(Evas_Object * obj)
      if (it)
         {
            eina_stringshare_del(it->label);
-           evas_object_del(VIEW(wd->first));
+           evas_object_del(VIEW(it));
            free(it);
         }
    }