diff --git a/menu/menu_displaylist.c b/menu/menu_displaylist.c index 6062c42744..1e8d434747 100644 --- a/menu/menu_displaylist.c +++ b/menu/menu_displaylist.c @@ -638,55 +638,46 @@ static unsigned menu_displaylist_parse_system_info(menu_displaylist_info_t *info switch (state) { case FRONTEND_POWERSTATE_NONE: - tmp2[copied] = ' '; - tmp2[copied+1] = '\0'; - strlcat(tmp2, + string_add_space_fast (tmp2, copied ); + copied = strlcat(tmp2, msg_hash_to_str( MENU_ENUM_LABEL_VALUE_NOT_AVAILABLE), sizeof(tmp2)); break; case FRONTEND_POWERSTATE_NO_SOURCE: - tmp2[copied] = ' '; - tmp2[copied+1] = '('; - tmp2[copied+2] = '\0'; + string_add_space_fast (tmp2, copied ); + string_add_pair_open_fast (tmp2, copied+1); copied = strlcat(tmp2, msg_hash_to_str( MENU_ENUM_LABEL_VALUE_SYSTEM_INFO_POWER_SOURCE_NO_SOURCE), sizeof(tmp2)); - tmp2[copied] = ')'; - tmp2[copied+1] = '\0'; + string_add_pair_close_fast(tmp2, copied ); break; case FRONTEND_POWERSTATE_CHARGING: - tmp2[copied] = ' '; - tmp2[copied+1] = '('; - tmp2[copied+2] = '\0'; + string_add_space_fast (tmp2, copied ); + string_add_pair_open_fast (tmp2, copied+1); copied = strlcat(tmp2, msg_hash_to_str( MENU_ENUM_LABEL_VALUE_SYSTEM_INFO_POWER_SOURCE_CHARGING), sizeof(tmp2)); - tmp2[copied] = ')'; - tmp2[copied+1] = '\0'; + string_add_pair_close_fast(tmp2, copied ); break; case FRONTEND_POWERSTATE_CHARGED: - tmp2[copied] = ' '; - tmp2[copied+1] = '('; - tmp2[copied+2] = '\0'; + string_add_space_fast (tmp2, copied ); + string_add_pair_open_fast (tmp2, copied+1); copied = strlcat(tmp2, msg_hash_to_str( MENU_ENUM_LABEL_VALUE_SYSTEM_INFO_POWER_SOURCE_CHARGED), sizeof(tmp2)); - tmp2[copied] = ')'; - tmp2[copied+1] = '\0'; + string_add_pair_close_fast(tmp2, copied ); break; case FRONTEND_POWERSTATE_ON_POWER_SOURCE: - tmp2[copied] = ' '; - tmp2[copied+1] = '('; - tmp2[copied+2] = '\0'; + string_add_space_fast (tmp2, copied ); + string_add_pair_open_fast (tmp2, copied+1); copied = strlcat(tmp2, msg_hash_to_str( MENU_ENUM_LABEL_VALUE_SYSTEM_INFO_POWER_SOURCE_DISCHARGING), sizeof(tmp2)); - tmp2[copied] = ')'; - tmp2[copied+1] = '\0'; + string_add_pair_close_fast(tmp2, copied ); break; }