mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-12-07 05:35:02 -05:00
settings set_file() cleanup unused maxlen and check for file exist
maxlen is set to MAX_FILENAME by all callers so lets just make that part of the deal check the file exists before we set it Change-Id: I3074f3164fcd4b8873b69612d5c1a51a39de4baf
This commit is contained in:
parent
14898bc19e
commit
bdf89bf4b0
4 changed files with 23 additions and 20 deletions
|
|
@ -197,7 +197,7 @@ void radio_save_presets(void)
|
|||
close(fd);
|
||||
|
||||
if (strcasestr(filepreset, FMPRESET_PATH))
|
||||
set_file(filepreset, global_settings.fmr_file, MAX_FILENAME);
|
||||
set_file(filepreset, global_settings.fmr_file);
|
||||
presets_changed = false;
|
||||
}
|
||||
else
|
||||
|
|
@ -240,7 +240,7 @@ void radio_load_presets(const char *filename)
|
|||
|
||||
/* Preset inside the default folder? */
|
||||
if (strcasestr(filepreset, FMPRESET_PATH))
|
||||
set_file(filepreset, global_settings.fmr_file, MAX_FILENAME);
|
||||
set_file(filepreset, global_settings.fmr_file);
|
||||
/* else Temporary preset, loaded until player shuts down. */
|
||||
|
||||
fd = open_utf8(filepreset, O_RDONLY);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue