retv_if(!img_edje, ECORE_CALLBACK_CANCEL);
char signal_to_emit[32] = {'\0',};
- sprintf(signal_to_emit,icon->signal_to_emit_prefix,icon->animation_state);
+ snprintf(signal_to_emit, sizeof(signal_to_emit), icon->signal_to_emit_prefix,icon->animation_state);
edje_object_signal_emit(img_edje, signal_to_emit,"prog");
nIndex = 1;
{
char temp[30] = {0,};
- sprintf(temp,"indicator.padding.resize.%d",nMove);
+ snprintf(temp,sizeof(temp), "indicator.padding.resize.%d",nMove);
util_signal_emit(data,temp,"indicator.prog");
}
icon_set_update_flag(0);
if (EINA_FALSE == elm_layout_file_set(ad->win.layout, file, group)) {
_E("Failed to set file of layout");
evas_object_del(ad->win.layout);
- return NULL;
+ return;
}
evas_object_size_hint_min_set(ad->win.layout, ad->win.w, ad->win.h);
{
struct appdata *ad = data;
int ret;
+ char buf[256];
retv_if(!ad, false);
ret = sigemptyset(&act.sa_mask);
if (ret < 0) {
- _E("Failed to sigemptyset[%s]", strerror(errno));
+ _E("Failed to sigemptyset[%s]", strerror_r(errno, buf, sizeof(buf)));
}
ret = sigaddset(&act.sa_mask, SIGTERM);
if (ret < 0) {
- _E("Failed to sigaddset[%s]", strerror(errno));
+ _E("Failed to sigaddset[%s]", strerror_r(errno, buf, sizeof(buf)));
}
ret = sigaction(SIGTERM, &act, NULL);
if (ret < 0) {
- _E("Failed to sigaction[%s]", strerror(errno));
+ _E("Failed to sigaction[%s]", strerror_r(errno, buf, sizeof(buf)));
}
ret = _start_indicator(ad);
*str_line1 = strdup(tmp);
}
}
-
- eina_strbuf_free(line1);
- eina_strbuf_free(line2);
} else {
_E("failed to allocate string buffer");
}
+ if (line1 != NULL) {
+ eina_strbuf_free(line1);
+ }
+ if (line2 != NULL) {
+ eina_strbuf_free(line2);
+ }
} else {
if (title_utf8 == NULL
&& event_count_utf8 == NULL
}
}
- eina_strbuf_free(line1);
- eina_strbuf_free(line2);
} else {
_E("failed to allocate string buffer");
}
+ if (line1 != NULL) {
+ eina_strbuf_free(line1);
+ }
+ if (line2 != NULL) {
+ eina_strbuf_free(line2);
+ }
} else {
if (title_utf8 == NULL
&& content_utf8 == NULL
/* Set time */
ctime = time(NULL);
- ts = localtime(&ctime);
+ localtime_r(&ctime, ts);
if (ts == NULL) {
_E("Fail to get localtime !");
return;
static int unregister_clock_module(void)
{
- int ret;
+ int ret = 0;
//ret = system_settings_unset_changed_cb(SYSTEM_SETTINGS_KEY_TIME_CHANGED);
ret = ret | vconf_ignore_key_changed(VCONFKEY_REGIONFORMAT_TIME1224, regionformat_changed);
int idx = 0;
int out_idx = 0;
int out_sz = 0;
+ int replace_len = 0;
+
enum {
STATE_START,
STATE_FIND,
return NULL;
}
+ replace_len = strlen(replace);
+ if (replace_len) {
+ ERR("Ratio");
+ return NULL;
+ }
+
out_idx = 0;
for (state = STATE_START, ptr = src; state != STATE_END; ptr++) {
switch (state) {
* If there is no space for copying the replacement,
* Extend size of the return buffer.
*/
- if (out_sz - out_idx < strlen(replace) + 1) {
+ if (out_sz - out_idx < replace_len + 1) {
tmp = _extend_heap(ret, &out_sz, strlen(replace) + 1);
if (!tmp) {
free(ret);
ret = tmp;
}
- strcpy(ret + out_idx, replace);
+ strncpy(ret + out_idx, replace, replace_len);
out_idx += strlen(replace);
state = STATE_FIND;
if(clock_mode == INDICATOR_CLOCK_MODE_12H)
{
- strcpy(time_skeleton,"hm");
+ strncpy(time_skeleton,"hm", 2);
}
else
{
- strcpy(time_skeleton,"Hm");
+ strncpy(time_skeleton,"Hm", 2);
}
char* timezone_id = NULL;
timezone_id = util_get_timezone_str();
bestPatternCapacity, &status);
char a_best_pattern[64] = {0,};
+ char *last_pattern = NULL;
u_austrcpy(a_best_pattern, bestPattern);
- char *a_best_pattern_fixed = strtok(a_best_pattern, "a");
- a_best_pattern_fixed = strtok(a_best_pattern_fixed, " ");
+ char *a_best_pattern_fixed = strtok_r(a_best_pattern, "a", &last_pattern);
+ a_best_pattern_fixed = strtok_r(a_best_pattern_fixed, " ", &last_pattern);
if(a_best_pattern_fixed)
{
u_uastrcpy(bestPattern, a_best_pattern_fixed);
retif(data == NULL, FAIL, "Invalid parameter!");
set_app_state(data);
- if (ret < 0)
- {
- ERR("Fail to init alarmdb.");
- return FAIL;
- }
ret = vconf_notify_key_changed(VCONFKEY_ALARM_STATE,
indicator_alarm_change_cb, data);
FILE* fp = fopen(MUSIC_STATUS_FILE_PATH, "r");
char line[MAX_NAM_LEN+1];
- retif(data == NULL, , "Invalid parameter!");
+ if (data == NULL) {
+ ERR("Invalid parameter");
+ if (fp) {
+ fclose(fp);
+ }
+ return;
+ }
if(fp == NULL)
{
ERR("Invalid file path !!");
static Eina_Bool show_downloading_icon_cb(void* data)
{
+ int possible_index = 0;
show_image_icon(data,icon_index);
- icon_index = (++icon_index % ICON_NUM) ? icon_index : 0;
+ possible_index = ++icon_index % ICON_NUM;
+
+ icon_index = possible_index ? icon_index : 0;
return ECORE_CALLBACK_RENEW;
}
ERR("Error getting VCONFKEY_WIFI_DIRECT_RECEIVING_STATE value");
}*/
- if (result == 1) {
+/* if (result == 1) {
show_downloading_icon(data);
} else {
hide_downloading_icon();
- }
+ }*/
+ hide_downloading_icon();
}
static void indicator_downloading_pm_state_change_cb(keynode_t *node, void *data)
static Eina_Bool show_uploading_icon_cb(void* data)
{
+ int possible_index = 0;
+
show_image_icon(data,icon_index);
- icon_index = (++icon_index % ICON_NUM) ? icon_index : 0;
+ possible_index = ++icon_index % ICON_NUM;
+
+ icon_index = possible_index ? icon_index : 0;
return ECORE_CALLBACK_RENEW;
}
ERR("Failed to get VCONFKEY_WIFI_DIRECT_SENDING_STATE value");
}*/
- if (result == 1) {
+/* if (result == 1) {
show_uploading_icon(data);
} else {
hide_uploading_icon();
- }
+ }*/
+ hide_uploading_icon();
}
static void indicator_uploading_pm_state_change_cb(keynode_t *node, void *data)
static int unregister_silent_module(void)
{
- int ret;
+ int ret = 0;
// ret = system_settings_unset_changed_cb(SYSTEM_SETTINGS_KEY_SOUND_SILENT_MODE);
ret = ret | vconf_ignore_key_changed(VCONFKEY_SETAPPL_VIBRATION_STATUS_BOOL, _silent_change_cb);