{
if (my_voicedata && my_voicedata->partial_result) {
LOGD("***** result_text : %s *******", my_voicedata->partial_result);
- char *retStr = (char *)calloc(strlen(my_voicedata->partial_result) + 1, sizeof(char));
- strncpy(retStr, my_voicedata->partial_result, strlen(my_voicedata->partial_result));
+ const int BUF_LEN = strlen(my_voicedata->partial_result) + 1;
+ char retStr[BUF_LEN] = {0};
+ snprintf(retStr, BUF_LEN, "%s", my_voicedata->partial_result);
ise_send_string(retStr);
- free(retStr);
}
}
const int BUF_LEN = 256;
static char buf[BUF_LEN] = {0};
- snprintf(buf, BUF_LEN, gettext("IDS_ST_SK_CANCEL"));
+ snprintf(buf, BUF_LEN, "%s", gettext("IDS_ST_SK_CANCEL"));
if (g_ui)
g_ui->set_string_substitution("Cancel", buf);
}
static char *__get_genlist_item_label(void *data, Evas_Object *obj, const char *part)
{
- char text[128] = {0, };
+ const int BUF_LEN = 128;
+ char text[BUF_LEN] = {'\0', };
if (!strcmp(part, "elm.text"))
{
if (p) {
strncpy(text, s, p-s);
} else {
- strncpy(text, s, strlen(s));
+ snprintf(text, BUF_LEN, "%s", s);
}
} else {
- strncpy(text, "", strlen(""));
+ snprintf(text, BUF_LEN, "%s", "");
}
}
return strdup(text);
if (p) {
strncpy(text, p+1, strlen(s)-(p-s)-2);
} else {
- strncpy(text, s, strlen(s));
- text[strlen(s)] = '\0';
+ snprintf(text, BUF_LEN, "%s", s);
}
} else {
- strncpy(text, "", strlen(""));
+ snprintf(text, BUF_LEN, "%s", "");
}
return strdup(text);
}
for (i = 1; i < (long)(sizeof(disp_lang_array)/sizeof(disp_lang_array[0])); i++)
{
char *s = (char *)disp_lang_array[i];
-
- if (strchr(s, '(')){
- item = item_append(genlist, itc_1text, i, language_set_genlist_radio_cb, genlist);
- } else {
- item = item_append(genlist, itc_1text, i, language_set_genlist_radio_cb, genlist);
- }
+ item = item_append(genlist, itc_1text, i, language_set_genlist_radio_cb, genlist);
if (lang_val == i) {
LOGD("%d item is choiced.", i);