forked from len0rd/rockbox
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
|
|
@ -2307,8 +2307,9 @@ static bool cpu_boost_log_dump(void)
|
|||
return false;
|
||||
|
||||
#if CONFIG_RTC
|
||||
char fname[MAX_PATH];
|
||||
struct tm *nowtm = get_time();
|
||||
fd = open_pathfmt(O_CREAT|O_WRONLY|O_TRUNC,
|
||||
fd = open_pathfmt(fname, sizeof(fname), O_CREAT|O_WRONLY|O_TRUNC,
|
||||
"%s/boostlog_%04d%02d%02d%02d%02d%02d.txt", ROCKBOX_DIR,
|
||||
nowtm->tm_year + 1900, nowtm->tm_mon + 1, nowtm->tm_mday,
|
||||
nowtm->tm_hour, nowtm->tm_min, nowtm->tm_sec);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue