mirror of
https://github.com/CTCaer/RetroArch.git
synced 2024-12-23 03:10:14 +00:00
Make sanitize_to_string safer
This commit is contained in:
parent
15bb8e2ebe
commit
642818d59c
@ -41,9 +41,13 @@ static void sanitize_to_string(char *s, const char *label, size_t len)
|
||||
|
||||
new_label[0] = '\0';
|
||||
|
||||
if (label && !string_is_empty(label))
|
||||
strlcpy(new_label, label, sizeof(new_label));
|
||||
if (s && !string_is_empty(new_label))
|
||||
{
|
||||
strlcpy(s, new_label, len);
|
||||
replace_chars(s, '_', ' ');
|
||||
}
|
||||
}
|
||||
|
||||
static int fill_title(char *s, const char *title, const char *path, size_t len)
|
||||
|
Loading…
Reference in New Issue
Block a user