mirror of
https://github.com/libretro/RetroArch
synced 2025-03-02 19:13:34 +00:00
We should use strlcpy instead of strncpy - this usage of strncpy
was also showing warnings with GCC 8.2
This commit is contained in:
parent
02eb650273
commit
116390b3e8
@ -129,10 +129,8 @@ bool cheat_manager_save(const char *path, const char *cheat_database, bool overw
|
||||
if ( (!cheat_manager_state.cheats) || cheat_manager_state.size==0 )
|
||||
return false ;
|
||||
|
||||
if ( cheat_database == NULL )
|
||||
{
|
||||
strncpy(cheats_file, path, PATH_MAX_LENGTH) ;
|
||||
}
|
||||
if (!cheat_database)
|
||||
strlcpy(cheats_file, path, sizeof(cheats_file));
|
||||
else
|
||||
{
|
||||
fill_pathname_join(buf, cheat_database, path, sizeof(buf));
|
||||
@ -140,13 +138,9 @@ bool cheat_manager_save(const char *path, const char *cheat_database, bool overw
|
||||
fill_pathname_noext(cheats_file, buf, ".cht", sizeof(cheats_file));
|
||||
}
|
||||
if ( !overwrite )
|
||||
{
|
||||
conf = config_file_new(cheats_file);
|
||||
}
|
||||
else
|
||||
{
|
||||
conf = config_file_new(NULL);
|
||||
}
|
||||
|
||||
if (!conf)
|
||||
conf = config_file_new(NULL);
|
||||
|
Loading…
x
Reference in New Issue
Block a user