use path_append for setting directories is several settings

sprintf, strcpy, memccpy can all just go thru path_append
with the added benefit of some path sanitizing too

Change-Id: I33510b56a364b8b3a0b06f2ff14b76491f6e3870
This commit is contained in:
William Wilgus 2024-03-31 22:08:55 -04:00
parent 47784a777e
commit 1dc22c7241
7 changed files with 23 additions and 22 deletions

View file

@ -63,6 +63,7 @@
#include "list.h"
#include "viewport.h"
#include "exported_menus.h"
#include "pathfuncs.h"
static bool no_source_in_menu = false;
static int recmenu_callback(int action,
@ -305,7 +306,8 @@ MENUITEM_SETTING(rec_prerecord_time, &global_settings.rec_prerecord_time, NULL);
static int clear_rec_directory(void)
{
strcpy(global_settings.rec_directory, REC_BASE_DIR);
path_append(global_settings.rec_directory, REC_BASE_DIR,
PA_SEP_HARD, sizeof(global_settings.rec_directory));
settings_save();
splash(HZ, ID2P(LANG_RESET_DONE_CLEAR));
return false;