mirror of
https://github.com/libretro/RetroArch
synced 2025-04-10 15:45:19 +00:00
Optimize sublabel_playlist_entry by removing snprintf
This commit is contained in:
parent
c186747edc
commit
8f8a9863ad
@ -1054,12 +1054,17 @@ static int action_bind_sublabel_playlist_entry(
|
|||||||
int n = 0;
|
int n = 0;
|
||||||
char tmp[64];
|
char tmp[64];
|
||||||
|
|
||||||
tmp[0] = '\0';
|
tmp[0 ] = '\n';
|
||||||
|
tmp[1 ] = '\0';
|
||||||
|
|
||||||
|
n = strlcat(tmp, entry->runtime_str, sizeof(tmp));
|
||||||
|
|
||||||
|
tmp[n ] = '\n';
|
||||||
|
tmp[n+1] = '\0';
|
||||||
|
|
||||||
/* Runtime/last played strings are now cached in the
|
/* Runtime/last played strings are now cached in the
|
||||||
* playlist, so we can add both in one go */
|
* playlist, so we can add both in one go */
|
||||||
n = snprintf(tmp, sizeof(tmp), "\n%s\n%s",
|
n = strlcat(tmp, entry->last_played_str, sizeof(tmp));
|
||||||
entry->runtime_str, entry->last_played_str);
|
|
||||||
|
|
||||||
if ((n < 0) || (n >= 64))
|
if ((n < 0) || (n >= 64))
|
||||||
n = 0; /* Silence GCC warnings... */
|
n = 0; /* Silence GCC warnings... */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user