diff options
author | William Wilgus <wilgus.william@gmail.com> | 2022-11-23 21:46:13 -0500 |
---|---|---|
committer | William Wilgus <wilgus.william@gmail.com> | 2022-11-23 22:09:46 -0500 |
commit | 3745c813f924b12232c4f37610aecd23fe5654b8 (patch) | |
tree | 41069cc3f39c61b7d0611877d4251827be6cd2e1 /apps/logfdisp.c | |
parent | 80b8b13544c79f57bf7da6320cee5d76c162e96c (diff) | |
download | rockbox-3745c813f924b12232c4f37610aecd23fe5654b8.tar.gz rockbox-3745c813f924b12232c4f37610aecd23fe5654b8.zip |
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
Diffstat (limited to 'apps/logfdisp.c')
-rw-r--r-- | apps/logfdisp.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/apps/logfdisp.c b/apps/logfdisp.c index aebc9ffb33..efbfa192f5 100644 --- a/apps/logfdisp.c +++ b/apps/logfdisp.c | |||
@@ -225,8 +225,9 @@ bool logfdump(void) | |||
225 | logfenabled = false; | 225 | logfenabled = false; |
226 | 226 | ||
227 | #if CONFIG_RTC | 227 | #if CONFIG_RTC |
228 | char fname[MAX_PATH]; | ||
228 | struct tm *nowtm = get_time(); | 229 | struct tm *nowtm = get_time(); |
229 | fd = open_pathfmt(O_CREAT|O_WRONLY|O_TRUNC, | 230 | fd = open_pathfmt(fname, sizeof(fname), O_CREAT|O_WRONLY|O_TRUNC, |
230 | "%s/logf_%04d%02d%02d%02d%02d%02d.txt", ROCKBOX_DIR, | 231 | "%s/logf_%04d%02d%02d%02d%02d%02d.txt", ROCKBOX_DIR, |
231 | nowtm->tm_year + 1900, nowtm->tm_mon + 1, nowtm->tm_mday, | 232 | nowtm->tm_year + 1900, nowtm->tm_mon + 1, nowtm->tm_mday, |
232 | nowtm->tm_hour, nowtm->tm_min, nowtm->tm_sec); | 233 | nowtm->tm_hour, nowtm->tm_min, nowtm->tm_sec); |