use strcpy_literal for string literals

This commit is contained in:
twinaphex 2020-09-21 00:59:37 +02:00
parent 7e0e3144be
commit 98e9109d45
3 changed files with 22 additions and 29 deletions

View File

@ -129,9 +129,9 @@ static void frontend_orbis_get_environment_settings(int *argc, char *argv[],
orbisPadInitWithConf(myConf->confPad);
scePadClose(myConf->confPad->padHandle);
strlcpy(eboot_path, "host0:app", sizeof(eboot_path));
strcpy_literal(eboot_path, "host0:app");
strlcpy(g_defaults.dirs[DEFAULT_DIR_PORT], eboot_path, sizeof(g_defaults.dirs[DEFAULT_DIR_PORT]));
strlcpy(user_path, "host0:app/data/retroarch/", sizeof(user_path));
strcpy_literal(user_path, "host0:app/data/retroarch/");
RARCH_LOG("port dir: [%s]\n", g_defaults.dirs[DEFAULT_DIR_PORT]);

View File

@ -90,14 +90,14 @@ static void frontend_psp_get_environment_settings(int *argc, char *argv[],
(void)args;
#ifdef VITA
strlcpy(eboot_path, "app0:/", sizeof(eboot_path));
strcpy_literal(eboot_path, "app0:/");
strlcpy(g_defaults.dirs[DEFAULT_DIR_PORT], eboot_path, sizeof(g_defaults.dirs[DEFAULT_DIR_PORT]));
strlcpy(user_path, "ux0:/data/retroarch/", sizeof(user_path));
strcpy_literal(user_path, "ux0:/data/retroarch/");
#else
strlcpy(eboot_path, argv[0], sizeof(eboot_path));
/* for PSP, use uppercase directories, and no trailing slashes
otherwise mkdir fails */
strlcpy(user_path, "ms0:/PSP/RETROARCH", sizeof(user_path));
strcpy_literal(user_path, "ms0:/PSP/RETROARCH");
fill_pathname_basedir(g_defaults.dirs[DEFAULT_DIR_PORT], argv[0], sizeof(g_defaults.dirs[DEFAULT_DIR_PORT]));
#endif
RARCH_LOG("port dir: [%s]\n", g_defaults.dirs[DEFAULT_DIR_PORT]);

View File

@ -99,8 +99,7 @@ static void frontend_xdk_get_environment_settings(int *argc, char *argv[],
#endif
#if defined(_XBOX1)
strlcpy(g_defaults.dirs[DEFAULT_DIR_CORE],
"D:", sizeof(g_defaults.dirs[DEFAULT_DIR_CORE]));
strcpy_literal(g_defaults.dirs[DEFAULT_DIR_CORE], "D:");
fill_pathname_join(g_defaults.path_config, g_defaults.dirs[DEFAULT_DIR_CORE],
FILE_PATH_MAIN_CONFIG, sizeof(g_defaults.path_config));
fill_pathname_join(g_defaults.dirs[DEFAULT_DIR_SAVESTATE],
@ -142,28 +141,22 @@ static void frontend_xdk_get_environment_settings(int *argc, char *argv[],
g_defaults.dirs[DEFAULT_DIR_CORE],
"logs", sizeof(g_defaults.dirs[DEFAULT_DIR_LOGS]));
#elif defined(_XBOX360)
strlcpy(g_defaults.dirs[DEFAULT_DIR_CORE],
"game:",
sizeof(g_defaults.dirs[DEFAULT_DIR_CORE]));
strlcpy(g_defaults.path_config,
"game:\\retroarch.cfg", sizeof(g_defaults.path_config));
strlcpy(g_defaults.dirs[DEFAULT_DIR_SCREENSHOT],
"game:",
sizeof(g_defaults.dirs[DEFAULT_DIR_SCREENSHOT]));
strlcpy(g_defaults.dirs[DEFAULT_DIR_SAVESTATE],
"game:\\savestates",
sizeof(g_defaults.dirs[DEFAULT_DIR_SAVESTATE]));
strlcpy(g_defaults.dirs[DEFAULT_DIR_PLAYLIST],
"game:\\playlists",
sizeof(g_defaults.dirs[DEFAULT_DIR_PLAYLIST]));
strlcpy(g_defaults.dirs[DEFAULT_DIR_SRAM],
"game:\\savefiles",
sizeof(g_defaults.dirs[DEFAULT_DIR_SRAM]));
strlcpy(g_defaults.dirs[DEFAULT_DIR_SYSTEM],
"game:\\system", sizeof(g_defaults.dirs[DEFAULT_DIR_SYSTEM]));
strlcpy(g_defaults.dirs[DEFAULT_DIR_LOGS],
"game:\\logs",
sizeof(g_defaults.dirs[DEFAULT_DIR_LOGS]));
strcpy_literal(g_defaults.dirs[DEFAULT_DIR_CORE],
"game:");
strcpy_literal(g_defaults.path_config,
"game:\\retroarch.cfg");
strcpy_literal(g_defaults.dirs[DEFAULT_DIR_SCREENSHOT],
"game:");
strcpy_literal(g_defaults.dirs[DEFAULT_DIR_SAVESTATE],
"game:\\savestates");
strcpy_literal(g_defaults.dirs[DEFAULT_DIR_PLAYLIST],
"game:\\playlists");
strcpy_literal(g_defaults.dirs[DEFAULT_DIR_SRAM],
"game:\\savefiles");
strcpy_literal(g_defaults.dirs[DEFAULT_DIR_SYSTEM],
"game:\\system");
strcpy_literal(g_defaults.dirs[DEFAULT_DIR_LOGS],
"game:\\logs");
#endif
fill_pathname_join(g_defaults.dirs[DEFAULT_DIR_CORE_INFO],
g_defaults.dirs[DEFAULT_DIR_CORE],