mirror of
https://github.com/libretro/RetroArch
synced 2025-02-07 03:40:24 +00:00
Simplify sanitize_to_string further
This commit is contained in:
parent
1679124361
commit
2d9727f499
@ -31,8 +31,6 @@
|
||||
static void sanitize_to_string(char *s, const char *label, size_t len)
|
||||
{
|
||||
char *pos = NULL;
|
||||
if (string_is_empty(label) || !s)
|
||||
return;
|
||||
|
||||
strlcpy(s, label, len);
|
||||
|
||||
@ -51,14 +49,17 @@ static int fill_title(char *s, const char *title, const char *path, size_t len)
|
||||
static int action_get_title_action_generic(const char *path, const char *label,
|
||||
unsigned menu_type, char *s, size_t len)
|
||||
{
|
||||
sanitize_to_string(s, label, len);
|
||||
if (s && !string_is_empty(label))
|
||||
sanitize_to_string(s, label, len);
|
||||
return 0;
|
||||
}
|
||||
|
||||
#define default_title_macro(func_name, lbl) \
|
||||
static int (func_name)(const char *path, const char *label, unsigned menu_type, char *s, size_t len) \
|
||||
{ \
|
||||
sanitize_to_string(s, msg_hash_to_str(lbl), len); \
|
||||
const char *str = msg_hash_to_str(lbl); \
|
||||
if (s && !string_is_empty(str)) \
|
||||
sanitize_to_string(s, str, len); \
|
||||
return 0; \
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user