mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-10-13 18:17:39 -04:00
misc.c open_pathfmt caller supplied buffer
Amachronic raised concern about open() blocking causing a static buf to get overwritten in multiple calls its prudent to just have the caller supply the buffer to minimize stack issues later Change-Id: Iae27c7d063adb1a65688f920f6aa5c395fa5694a
This commit is contained in:
parent
80b8b13544
commit
3745c813f9
9 changed files with 34 additions and 27 deletions
|
@ -247,6 +247,7 @@ static struct buflib_callbacks talk_ops = {
|
|||
|
||||
static int open_voicefile(void)
|
||||
{
|
||||
char fname[MAX_PATH];
|
||||
char* p_lang = DEFAULT_VOICE_LANG; /* default */
|
||||
|
||||
if ( global_settings.lang_file[0] &&
|
||||
|
@ -255,7 +256,8 @@ static int open_voicefile(void)
|
|||
p_lang = (char *)global_settings.lang_file;
|
||||
}
|
||||
|
||||
return open_pathfmt(O_RDONLY, LANG_DIR "/%s.voice", p_lang);
|
||||
return open_pathfmt(fname, sizeof(fname),
|
||||
O_RDONLY, LANG_DIR "/%s.voice", p_lang);
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue