mirror of
https://github.com/libretro/RetroArch
synced 2025-04-07 13:23:32 +00:00
Cutdown on some strlens
This commit is contained in:
parent
f39f1f6ff2
commit
3c1e64129e
@ -2088,6 +2088,7 @@ static void win32_localize_menu(HMENU menu)
|
|||||||
if (label_enum != MSG_UNKNOWN)
|
if (label_enum != MSG_UNKNOWN)
|
||||||
{
|
{
|
||||||
int len;
|
int len;
|
||||||
|
size_t len2;
|
||||||
#ifndef LEGACY_WIN32
|
#ifndef LEGACY_WIN32
|
||||||
wchar_t* new_label_unicode = NULL;
|
wchar_t* new_label_unicode = NULL;
|
||||||
#else
|
#else
|
||||||
@ -2104,18 +2105,26 @@ static void win32_localize_menu(HMENU menu)
|
|||||||
Fullscreen = "Alt+Enter" */
|
Fullscreen = "Alt+Enter" */
|
||||||
if (label_enum ==
|
if (label_enum ==
|
||||||
MENU_ENUM_LABEL_VALUE_LOAD_CONTENT_LIST)
|
MENU_ENUM_LABEL_VALUE_LOAD_CONTENT_LIST)
|
||||||
meta_key_name = "Ctrl+O";
|
{
|
||||||
|
meta_key_name = "Ctrl+O";
|
||||||
|
len2 = STRLEN_CONST("Ctrl+O");
|
||||||
|
}
|
||||||
else if (label_enum ==
|
else if (label_enum ==
|
||||||
MENU_ENUM_LABEL_VALUE_INPUT_META_FULLSCREEN_TOGGLE_KEY)
|
MENU_ENUM_LABEL_VALUE_INPUT_META_FULLSCREEN_TOGGLE_KEY)
|
||||||
meta_key_name = "Alt+Enter";
|
{
|
||||||
|
meta_key_name = "Alt+Enter";
|
||||||
|
len2 = STRLEN_CONST("Alt+Enter");
|
||||||
|
}
|
||||||
else if (meta_key != 0)
|
else if (meta_key != 0)
|
||||||
meta_key_name = meta_key_to_name(meta_key);
|
{
|
||||||
|
meta_key_name = meta_key_to_name(meta_key);
|
||||||
|
len2 = strlen(meta_key_name);
|
||||||
|
}
|
||||||
|
|
||||||
/* Append localized name, tab character, and Shortcut Key */
|
/* Append localized name, tab character, and Shortcut Key */
|
||||||
if (meta_key_name && string_is_not_equal(meta_key_name, "nul"))
|
if (meta_key_name && string_is_not_equal(meta_key_name, "nul"))
|
||||||
{
|
{
|
||||||
size_t len1 = strlen(new_label);
|
size_t len1 = strlen(new_label);
|
||||||
size_t len2 = strlen(meta_key_name);
|
|
||||||
size_t buf_size = len1 + len2 + 2;
|
size_t buf_size = len1 + len2 + 2;
|
||||||
new_label_text = (char*)malloc(buf_size);
|
new_label_text = (char*)malloc(buf_size);
|
||||||
|
|
||||||
|
@ -4164,11 +4164,10 @@ static void ozone_update_content_metadata(ozone_handle_t *ozone)
|
|||||||
(ozone->dimensions.thumbnail_bar_width
|
(ozone->dimensions.thumbnail_bar_width
|
||||||
- ((ozone->dimensions.sidebar_entry_icon_padding * 2) * 2))
|
- ((ozone->dimensions.sidebar_entry_icon_padding * 2) * 2))
|
||||||
/ ozone->fonts.footer.glyph_width;
|
/ ozone->fonts.footer.glyph_width;
|
||||||
|
size_t _len = strlcpy(tmpstr, ozone->selection_core_name, sizeof(tmpstr));
|
||||||
strlcpy(tmpstr, ozone->selection_core_name, sizeof(tmpstr));
|
|
||||||
(ozone->word_wrap)(ozone->selection_core_name,
|
(ozone->word_wrap)(ozone->selection_core_name,
|
||||||
sizeof(ozone->selection_core_name),
|
sizeof(ozone->selection_core_name),
|
||||||
tmpstr, strlen(tmpstr),
|
tmpstr, _len,
|
||||||
metadata_len, ozone->fonts.footer.wideglyph_width, 0);
|
metadata_len, ozone->fonts.footer.wideglyph_width, 0);
|
||||||
ozone->selection_core_name_lines = ozone_count_lines(ozone->selection_core_name);
|
ozone->selection_core_name_lines = ozone_count_lines(ozone->selection_core_name);
|
||||||
}
|
}
|
||||||
@ -4227,10 +4226,9 @@ static void ozone_update_content_metadata(ozone_handle_t *ozone)
|
|||||||
* (unlike core names), so this should never overflow the
|
* (unlike core names), so this should never overflow the
|
||||||
* side bar */
|
* side bar */
|
||||||
char tmpstr[256];
|
char tmpstr[256];
|
||||||
|
size_t _len = strlcpy(tmpstr, ozone->selection_lastplayed, sizeof(tmpstr));
|
||||||
strlcpy(tmpstr, ozone->selection_lastplayed, sizeof(tmpstr));
|
|
||||||
(ozone->word_wrap)(ozone->selection_lastplayed,
|
(ozone->word_wrap)(ozone->selection_lastplayed,
|
||||||
sizeof(ozone->selection_lastplayed), tmpstr, strlen(tmpstr), 30, 100, 0);
|
sizeof(ozone->selection_lastplayed), tmpstr, _len, 30, 100, 0);
|
||||||
ozone->selection_lastplayed_lines = ozone_count_lines(ozone->selection_lastplayed);
|
ozone->selection_lastplayed_lines = ozone_count_lines(ozone->selection_lastplayed);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
Loading…
x
Reference in New Issue
Block a user