char buf[256] = "\0";
if (event->detail1) {
if (role == ATSPI_ROLE_TOGGLE_BUTTON)
- g_strlcat(buf, _("IDS_MSG_BODY_ON_T_TTS"), sizeof(buf) - strlen(buf) - 1);
+ g_strlcat(buf, _("IDS_MSG_BODY_ON_T_TTS"), sizeof(buf));
else if (role == ATSPI_ROLE_CHECK_BOX)
- g_strlcat(buf, _("COM_TV_SID_CHECKED"), sizeof(buf) - strlen(buf) - 1);
+ g_strlcat(buf, _("COM_TV_SID_CHECKED"), sizeof(buf));
else
- g_strlcat(buf, _("IDS_ACCS_BODY_SELECTED_TTS"), sizeof(buf) - strlen(buf) - 1);
+ g_strlcat(buf, _("IDS_ACCS_BODY_SELECTED_TTS"), sizeof(buf));
} else {
if (role == ATSPI_ROLE_TOGGLE_BUTTON)
- g_strlcat(buf, _("IDS_STORYALBUM_BODY_OFF_T_TTS"), sizeof(buf) - strlen(buf) - 1);
+ g_strlcat(buf, _("IDS_STORYALBUM_BODY_OFF_T_TTS"), sizeof(buf));
else if (role == ATSPI_ROLE_CHECK_BOX)
- g_strlcat(buf, _("COM_TV_SID_UNCHECKED"), sizeof(buf) - strlen(buf) - 1);
+ g_strlcat(buf, _("COM_TV_SID_UNCHECKED"), sizeof(buf));
else
- g_strlcat(buf, _("IDS_ACCS_OPT_NOT_SELECTED_TTS"), sizeof(buf) - strlen(buf) - 1);
+ g_strlcat(buf, _("IDS_ACCS_OPT_NOT_SELECTED_TTS"), sizeof(buf));
}
tw_speak(buf, EINA_TRUE);
} else if (!g_strcmp0(event->type, "object:state-changed:selected")
char tab_index[16] = "\0";
int children_count = atspi_accessible_get_child_count(parent, NULL);
int index = atspi_accessible_get_index_in_parent(event->source, NULL);
- g_strlcat(buf, name, sizeof(buf) - strlen(buf) - 1);
- g_strlcat(buf, ", ", sizeof(buf) - strlen(buf) - 1);
+ g_strlcat(buf, name, sizeof(buf));
+ g_strlcat(buf, ", ", sizeof(buf));
SUPPRESS_FORMAT_ERROR(g_snprintf(tab_index, sizeof(tab_index), _("IDS_ACCS_BODY_TAB_P1SD_OF_P2SD"), index + 1, children_count));
- g_strlcat(buf, tab_index, sizeof(buf) - strlen(buf) - 1);
- g_strlcat(buf, ", ", sizeof(buf) - strlen(buf) - 1);
+ g_strlcat(buf, tab_index, sizeof(buf));
+ g_strlcat(buf, ", ", sizeof(buf));
if (event->detail1)
- g_strlcat(buf, _("IDS_ACCS_BODY_SELECTED_TTS"), sizeof(buf) - strlen(buf) - 1);
+ g_strlcat(buf, _("IDS_ACCS_BODY_SELECTED_TTS"), sizeof(buf));
else
- g_strlcat(buf, _IGNORE_ON_TV("IDS_ACCS_BODY_DOUBLE_TAP_TO_SELECT_TTS"), sizeof(buf) - strlen(buf) - 1);
+ g_strlcat(buf, _IGNORE_ON_TV("IDS_ACCS_BODY_DOUBLE_TAP_TO_SELECT_TTS"), sizeof(buf));
tw_speak(buf, EINA_TRUE);
} else if (role == ATSPI_ROLE_LIST_ITEM && atspi_accessible_get_role(parent, NULL) == ATSPI_ROLE_TREE_TABLE) {
if (event->detail1) {
}
if ((event->detail2 == 1) && isupper((int)*text)) {
SUPPRESS_FORMAT_ERROR(g_snprintf(buf, sizeof(buf), _("IDS_ACCS_OPT_CAPITAL_PS_TTS"), text));
- g_strlcat(buf, " ", sizeof(buf) - strlen(buf) - 1);
+ g_strlcat(buf, " ", sizeof(buf));
} else if ((symtext = symbol_lookup(text))) {
g_strlcat(buf, _(symtext), sizeof(buf));
} else {
- g_strlcat(buf, text, sizeof(buf) - strlen(buf) - 1);
+ g_strlcat(buf, text, sizeof(buf));
}
DEBUG("Text Inserted :%s", buf);
else if ((symtext = symbol_lookup(text)))
g_strlcat(buf, _(symtext), sizeof(buf));
else
- g_strlcat(buf, text, sizeof(buf) - strlen(buf) - 1);
- g_strlcat(buf, " ", sizeof(buf) - strlen(buf) - 1);
+ g_strlcat(buf, text, sizeof(buf));
+ g_strlcat(buf, " ", sizeof(buf));
SUPPRESS_FORMAT_ERROR(g_snprintf(buf_deleted, sizeof(buf_deleted), _("IDS_ACCS_TBOPT_PS_DELETED"), ""));
- g_strlcat(buf, buf_deleted, sizeof(buf) - strlen(buf) - 1);
+ g_strlcat(buf, buf_deleted, sizeof(buf));
if (event->detail1 == 0) {
iface_text = atspi_accessible_get_text_iface(event->source);
if (iface_text) {
etext = atspi_text_get_text(iface_text, 0, atspi_text_get_character_count(iface_text, NULL), NULL);
if (etext) {
if (!g_strcmp0(etext, "")) {
- g_strlcat(buf, " ", sizeof(buf) - strlen(buf) - 1);//entry should be empty, need to find/get more detail here
- g_strlcat(buf, _("IDS_ACCS_BODY_ALL_CHARACTERS_DELETED_TTS"), sizeof(buf) - strlen(buf) - 1);
+ g_strlcat(buf, " ", sizeof(buf));//entry should be empty, need to find/get more detail here
+ g_strlcat(buf, _("IDS_ACCS_BODY_ALL_CHARACTERS_DELETED_TTS"), sizeof(buf));
}
free(etext);
}
name = atspi_accessible_get_name(child, NULL);
DEBUG("%d child name:%s", i, name);
if (name && strncmp(name, "\0", 1))
- g_strlcat(ret, name, sizeof(ret) - strlen(ret) - 1);
- g_strlcat(ret, " ", sizeof(ret) - strlen(ret) - 1);
+ g_strlcat(ret, name, sizeof(ret));
+ g_strlcat(ret, " ", sizeof(ret));
below = generate_description_for_subtree(child);
if (strncmp(below, "\0", 1))
- g_strlcat(ret, below, sizeof(ret) - strlen(ret) - 1);
+ g_strlcat(ret, below, sizeof(ret));
g_clear_object(&child);
g_free(below);
g_free(name);
{
char ret[TTS_MAX_TEXT_SIZE] = "\0";
- g_strlcpy(ret, g_value_get_string(&event->any_data), sizeof(ret) - 1);
- g_strlcat(ret, " ", sizeof(ret) - strlen(ret) - 1);
- g_strlcat(ret, _("IDS_HEALTH_TBBODY_REMOVED"), sizeof(ret) - strlen(ret) - 1);
+ g_strlcpy(ret, g_value_get_string(&event->any_data), sizeof(ret));
+ g_strlcat(ret, " ", sizeof(ret));
+ g_strlcat(ret, _("IDS_HEALTH_TBBODY_REMOVED"), sizeof(ret));
//FIXME : This IDS value is not supported.
/*else {
- g_strlcpy(ret, _("IDS_TEXT_REMOVED"), sizeof(ret) - 1);
+ g_strlcpy(ret, _("IDS_TEXT_REMOVED"), sizeof(ret));
}*/
if (event->detail1 != spi->last_caret_position) {
//FIXME : This IDS value is not supported.
/*if (event->detail1 == 0) {
- g_strlcat(ret, _("IDS_REACHED_MIN_POS"), sizeof(ret) - strlen(ret) - 1);
+ g_strlcat(ret, _("IDS_REACHED_MIN_POS"), sizeof(ret));
}*/
spi->ignore_next_caret_move = EINA_TRUE;
} /*else if (event->detail1 == spi_get_text_interface_text_length(event, user_data)) {
- g_strlcat(ret, _("IDS_REACHED_MAX_POS"), sizeof(ret) - strlen(ret) - 1);
+ g_strlcat(ret, _("IDS_REACHED_MAX_POS"), sizeof(ret));
}*/
return g_strdup(ret);
}
command->is_playing ? 'P' : '-',
length, slices, text);
} else {
- g_snprintf(buffer, 64, "(nil)");
+ g_strlcpy(buffer, "(nil)", sizeof(buffer));
}
return buffer;
}
{
DEBUG("[START] checking if can discard: prev (%p), next(%p)", prev, next);
char buffer[64];
- g_snprintf(buffer, 64, "CAN DISCARD %s, %s",
+ g_snprintf(buffer, sizeof(buffer), "CAN DISCARD %s, %s",
prev ? (prev->discardable ? "prev discardable" : "prev non-discardable") : "prev nil",
next ? (next->want_discard_previous_reading ? "next want discard" : "next want no discard") : "next nil");
DEBUG("%s", buffer);
Read_Command *command = get_read_command_from_queue(tw, &(tw->read_command_queue));
if (command) {
char text[64];
- g_strlcpy(text, command->context.text, 63);
- text[63] = 0;
+ g_strlcpy(text, command->context.text, sizeof(text));
DEBUG("READ COMMAND text: %s", text);
DEBUG("TTS_STATE: %d", state);
DEBUG("TTS_STATE_NAME: %s", get_tts_state(state));
// A command that cannot be discarded and does not compress the queue is not allowed.
if (!discardable && !want_discard_previous_reading) {
char buffer[32];
- g_snprintf(buffer, 32, "%s", text_to_speak_sanitized);
+ g_snprintf(buffer, sizeof(buffer), "%s", text_to_speak_sanitized);
WARNING("rejecting non-discardable, non-compressing command '%s...'", buffer);
free(text_to_speak_sanitized);
return NULL;
tts_state_e state;
tts_get_state(tw->tts, &state);
char text[64];
- g_strlcpy(text, text_to_speak_sanitized, 63);
- text[63] = 0;
+ g_strlcpy(text, text_to_speak_sanitized, sizeof(text));
DEBUG("READ COMMAND PARAMS, TEXT: %s, DISCARDABLE: %d, ATSPI_OBJECT: %p, DELAY %d", text, discardable, obj, delay);
Read_Command *rc = g_malloc0(sizeof(Read_Command));