mirror of
https://github.com/libretro/RetroArch
synced 2025-02-22 12:40:09 +00:00
* Don't NULL terminate string if we pass it to strlcpy and/or a
file_path function that calls strlcpy under the hood * Replace some snprintf calls to strlcpy/strlcat
This commit is contained in:
parent
8d12918243
commit
e865ea83bd
25
command.c
25
command.c
@ -191,9 +191,9 @@ static void command_network_poll(command_t *handle)
|
|||||||
{
|
{
|
||||||
netcmd->cmd_source_len = sizeof(netcmd->cmd_source);
|
netcmd->cmd_source_len = sizeof(netcmd->cmd_source);
|
||||||
|
|
||||||
ret = recvfrom(netcmd->net_fd, buf, sizeof(buf) - 1, 0,
|
if ((ret = recvfrom(netcmd->net_fd, buf, sizeof(buf) - 1, 0,
|
||||||
(struct sockaddr*)&netcmd->cmd_source, &netcmd->cmd_source_len);
|
(struct sockaddr*)&netcmd->cmd_source,
|
||||||
if (ret <= 0)
|
&netcmd->cmd_source_len)) <= 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
buf[ret] = '\0';
|
buf[ret] = '\0';
|
||||||
@ -1101,8 +1101,6 @@ bool command_event_save_auto_state(
|
|||||||
return false;
|
return false;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
savestate_name_auto[0] = '\0';
|
|
||||||
|
|
||||||
strlcpy(savestate_name_auto,
|
strlcpy(savestate_name_auto,
|
||||||
runloop_st->name.savestate,
|
runloop_st->name.savestate,
|
||||||
sizeof(savestate_name_auto));
|
sizeof(savestate_name_auto));
|
||||||
@ -1172,7 +1170,8 @@ bool command_event_load_entry_state(void)
|
|||||||
|
|
||||||
entry_state_path[0] = '\0';
|
entry_state_path[0] = '\0';
|
||||||
|
|
||||||
if (!retroarch_get_entry_state_path(entry_state_path, sizeof(entry_state_path),
|
if (!retroarch_get_entry_state_path(
|
||||||
|
entry_state_path, sizeof(entry_state_path),
|
||||||
runloop_st->entry_state_slot))
|
runloop_st->entry_state_slot))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
@ -1212,8 +1211,6 @@ void command_event_load_auto_state(void)
|
|||||||
return;
|
return;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
savestate_name_auto[0] = '\0';
|
|
||||||
|
|
||||||
strlcpy(savestate_name_auto,
|
strlcpy(savestate_name_auto,
|
||||||
runloop_st->name.savestate,
|
runloop_st->name.savestate,
|
||||||
sizeof(savestate_name_auto));
|
sizeof(savestate_name_auto));
|
||||||
@ -1253,8 +1250,6 @@ void command_event_set_savestate_auto_index(settings_t *settings)
|
|||||||
if (!savestate_auto_index)
|
if (!savestate_auto_index)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
state_dir[0] = state_base[0] = '\0';
|
|
||||||
|
|
||||||
/* Find the file in the same directory as runloop_st->savestate_name
|
/* Find the file in the same directory as runloop_st->savestate_name
|
||||||
* with the largest numeral suffix.
|
* with the largest numeral suffix.
|
||||||
*
|
*
|
||||||
@ -1317,9 +1312,6 @@ void command_event_set_savestate_garbage_collect(
|
|||||||
unsigned min_idx = UINT_MAX;
|
unsigned min_idx = UINT_MAX;
|
||||||
const char *oldest_save = NULL;
|
const char *oldest_save = NULL;
|
||||||
|
|
||||||
state_dir[0] = '\0';
|
|
||||||
state_base[0] = '\0';
|
|
||||||
|
|
||||||
/* Similar to command_event_set_savestate_auto_index(),
|
/* Similar to command_event_set_savestate_auto_index(),
|
||||||
* this will find the lowest numbered save-state */
|
* this will find the lowest numbered save-state */
|
||||||
fill_pathname_basedir(state_dir, runloop_st->name.savestate,
|
fill_pathname_basedir(state_dir, runloop_st->name.savestate,
|
||||||
@ -1342,8 +1334,6 @@ void command_event_set_savestate_garbage_collect(
|
|||||||
const char *end = NULL;
|
const char *end = NULL;
|
||||||
const char *dir_elem = dir_list->elems[i].data;
|
const char *dir_elem = dir_list->elems[i].data;
|
||||||
|
|
||||||
elem_base[0] = '\0';
|
|
||||||
|
|
||||||
if (string_is_empty(dir_elem))
|
if (string_is_empty(dir_elem))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
@ -1429,7 +1419,6 @@ bool command_event_save_core_config(
|
|||||||
runloop_state_t *runloop_st = runloop_state_get_ptr();
|
runloop_state_t *runloop_st = runloop_state_get_ptr();
|
||||||
|
|
||||||
msg[0] = '\0';
|
msg[0] = '\0';
|
||||||
config_dir[0] = '\0';
|
|
||||||
|
|
||||||
if (!string_is_empty(dir_menu_config))
|
if (!string_is_empty(dir_menu_config))
|
||||||
strlcpy(config_dir, dir_menu_config, sizeof(config_dir));
|
strlcpy(config_dir, dir_menu_config, sizeof(config_dir));
|
||||||
@ -1519,8 +1508,7 @@ void command_event_save_current_config(enum override_type type)
|
|||||||
if (path_is_empty(RARCH_PATH_CONFIG))
|
if (path_is_empty(RARCH_PATH_CONFIG))
|
||||||
{
|
{
|
||||||
char msg[128];
|
char msg[128];
|
||||||
msg[0] = '\0';
|
strlcpy(msg, "[Config]: Config directory not set, cannot save configuration.", sizeof(msg));
|
||||||
strcpy_literal(msg, "[Config]: Config directory not set, cannot save configuration.");
|
|
||||||
runloop_msg_queue_push(msg, 1, 180, true, NULL, MESSAGE_QUEUE_ICON_DEFAULT, MESSAGE_QUEUE_CATEGORY_INFO);
|
runloop_msg_queue_push(msg, 1, 180, true, NULL, MESSAGE_QUEUE_ICON_DEFAULT, MESSAGE_QUEUE_CATEGORY_INFO);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -1537,7 +1525,6 @@ void command_event_save_current_config(enum override_type type)
|
|||||||
case OVERRIDE_CONTENT_DIR:
|
case OVERRIDE_CONTENT_DIR:
|
||||||
{
|
{
|
||||||
char msg[128];
|
char msg[128];
|
||||||
msg[0] = '\0';
|
|
||||||
if (config_save_overrides(type, &runloop_st->system))
|
if (config_save_overrides(type, &runloop_st->system))
|
||||||
{
|
{
|
||||||
strlcpy(msg, msg_hash_to_str(MSG_OVERRIDES_SAVED_SUCCESSFULLY), sizeof(msg));
|
strlcpy(msg, msg_hash_to_str(MSG_OVERRIDES_SAVED_SUCCESSFULLY), sizeof(msg));
|
||||||
|
@ -55,9 +55,6 @@ static bool core_backup_get_backup_dir(
|
|||||||
char core_file_id[PATH_MAX_LENGTH];
|
char core_file_id[PATH_MAX_LENGTH];
|
||||||
char tmp[PATH_MAX_LENGTH];
|
char tmp[PATH_MAX_LENGTH];
|
||||||
|
|
||||||
core_file_id[0] = '\0';
|
|
||||||
tmp[0] = '\0';
|
|
||||||
|
|
||||||
/* Extract core file 'ID' (name without extension + suffix)
|
/* Extract core file 'ID' (name without extension + suffix)
|
||||||
* from core path */
|
* from core path */
|
||||||
if (string_is_empty(dir_libretro) ||
|
if (string_is_empty(dir_libretro) ||
|
||||||
@ -113,8 +110,10 @@ static bool core_backup_get_backup_dir(
|
|||||||
/* Generates a timestamped core backup file path from
|
/* Generates a timestamped core backup file path from
|
||||||
* the specified core path. Returns true if successful */
|
* the specified core path. Returns true if successful */
|
||||||
bool core_backup_get_backup_path(
|
bool core_backup_get_backup_path(
|
||||||
const char *core_path, uint32_t crc, enum core_backup_mode backup_mode,
|
const char *core_path, uint32_t crc,
|
||||||
const char *dir_core_assets, char *backup_path, size_t len)
|
enum core_backup_mode backup_mode,
|
||||||
|
const char *dir_core_assets,
|
||||||
|
char *backup_path, size_t len)
|
||||||
{
|
{
|
||||||
time_t current_time;
|
time_t current_time;
|
||||||
struct tm time_info;
|
struct tm time_info;
|
||||||
@ -123,7 +122,6 @@ bool core_backup_get_backup_path(
|
|||||||
char backup_dir[PATH_MAX_LENGTH];
|
char backup_dir[PATH_MAX_LENGTH];
|
||||||
char backup_filename[PATH_MAX_LENGTH];
|
char backup_filename[PATH_MAX_LENGTH];
|
||||||
|
|
||||||
core_dir[0] = '\0';
|
|
||||||
backup_dir[0] = '\0';
|
backup_dir[0] = '\0';
|
||||||
backup_filename[0] = '\0';
|
backup_filename[0] = '\0';
|
||||||
|
|
||||||
|
78
core_info.c
78
core_info.c
@ -705,8 +705,6 @@ static core_info_cache_list_t *core_info_cache_read(const char *info_dir)
|
|||||||
|
|
||||||
/* Check whether a 'force refresh' file
|
/* Check whether a 'force refresh' file
|
||||||
* is present */
|
* is present */
|
||||||
file_path[0] = '\0';
|
|
||||||
|
|
||||||
if (string_is_empty(info_dir))
|
if (string_is_empty(info_dir))
|
||||||
strlcpy(file_path,
|
strlcpy(file_path,
|
||||||
FILE_PATH_CORE_INFO_CACHE_REFRESH, sizeof(file_path));
|
FILE_PATH_CORE_INFO_CACHE_REFRESH, sizeof(file_path));
|
||||||
@ -719,8 +717,6 @@ static core_info_cache_list_t *core_info_cache_read(const char *info_dir)
|
|||||||
return core_info_cache_list_new();
|
return core_info_cache_list_new();
|
||||||
|
|
||||||
/* Open info cache file */
|
/* Open info cache file */
|
||||||
file_path[0] = '\0';
|
|
||||||
|
|
||||||
if (string_is_empty(info_dir))
|
if (string_is_empty(info_dir))
|
||||||
strlcpy(file_path, FILE_PATH_CORE_INFO_CACHE, sizeof(file_path));
|
strlcpy(file_path, FILE_PATH_CORE_INFO_CACHE, sizeof(file_path));
|
||||||
else
|
else
|
||||||
@ -740,8 +736,7 @@ static core_info_cache_list_t *core_info_cache_read(const char *info_dir)
|
|||||||
return core_info_cache_list_new();
|
return core_info_cache_list_new();
|
||||||
|
|
||||||
/* Parse info cache file */
|
/* Parse info cache file */
|
||||||
parser = rjson_open_stream(file);
|
if (!(parser = rjson_open_stream(file)))
|
||||||
if (!parser)
|
|
||||||
{
|
{
|
||||||
RARCH_ERR("[Core Info] Failed to create JSON parser\n");
|
RARCH_ERR("[Core Info] Failed to create JSON parser\n");
|
||||||
goto end;
|
goto end;
|
||||||
@ -826,8 +821,6 @@ static bool core_info_cache_write(core_info_cache_list_t *list, const char *info
|
|||||||
char file_path[PATH_MAX_LENGTH];
|
char file_path[PATH_MAX_LENGTH];
|
||||||
size_t i, j;
|
size_t i, j;
|
||||||
|
|
||||||
file_path[0] = '\0';
|
|
||||||
|
|
||||||
if (!list)
|
if (!list)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
@ -854,8 +847,7 @@ static bool core_info_cache_write(core_info_cache_list_t *list, const char *info
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Write info cache */
|
/* Write info cache */
|
||||||
writer = rjsonwriter_open_stream(file);
|
if (!(writer = rjsonwriter_open_stream(file)))
|
||||||
if (!writer)
|
|
||||||
{
|
{
|
||||||
RARCH_ERR("[Core Info] Failed to create JSON writer\n");
|
RARCH_ERR("[Core Info] Failed to create JSON writer\n");
|
||||||
goto end;
|
goto end;
|
||||||
@ -1166,8 +1158,6 @@ static bool core_info_cache_write(core_info_cache_list_t *list, const char *info
|
|||||||
success = true;
|
success = true;
|
||||||
|
|
||||||
/* Remove 'force refresh' file, if required */
|
/* Remove 'force refresh' file, if required */
|
||||||
file_path[0] = '\0';
|
|
||||||
|
|
||||||
if (string_is_empty(info_dir))
|
if (string_is_empty(info_dir))
|
||||||
strlcpy(file_path,
|
strlcpy(file_path,
|
||||||
FILE_PATH_CORE_INFO_CACHE_REFRESH, sizeof(file_path));
|
FILE_PATH_CORE_INFO_CACHE_REFRESH, sizeof(file_path));
|
||||||
@ -1217,8 +1207,6 @@ bool core_info_cache_force_refresh(const char *path_info)
|
|||||||
{
|
{
|
||||||
char file_path[PATH_MAX_LENGTH];
|
char file_path[PATH_MAX_LENGTH];
|
||||||
|
|
||||||
file_path[0] = '\0';
|
|
||||||
|
|
||||||
/* Get 'force refresh' file path */
|
/* Get 'force refresh' file path */
|
||||||
if (string_is_empty(path_info))
|
if (string_is_empty(path_info))
|
||||||
strlcpy(file_path,
|
strlcpy(file_path,
|
||||||
@ -1341,14 +1329,11 @@ static core_path_list_t *core_info_path_list_new(const char *core_dir,
|
|||||||
char exts[32];
|
char exts[32];
|
||||||
size_t i;
|
size_t i;
|
||||||
|
|
||||||
exts[0] = '\0';
|
|
||||||
|
|
||||||
if (string_is_empty(core_exts) ||
|
if (string_is_empty(core_exts) ||
|
||||||
!path_list)
|
!path_list)
|
||||||
goto error;
|
goto error;
|
||||||
|
|
||||||
core_ext_list = string_split(core_exts, "|");
|
if (!(core_ext_list = string_split(core_exts, "|")))
|
||||||
if (!core_ext_list)
|
|
||||||
goto error;
|
goto error;
|
||||||
|
|
||||||
/* Allocate list containers */
|
/* Allocate list containers */
|
||||||
@ -1478,13 +1463,13 @@ static bool core_info_path_is_locked(
|
|||||||
uint32_t hash;
|
uint32_t hash;
|
||||||
char lock_filename[NAME_MAX_LENGTH];
|
char lock_filename[NAME_MAX_LENGTH];
|
||||||
|
|
||||||
lock_filename[0] = '\0';
|
|
||||||
|
|
||||||
if (lock_list->size < 1)
|
if (lock_list->size < 1)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
snprintf(lock_filename, sizeof(lock_filename),
|
strlcpy(lock_filename, core_file_name,
|
||||||
"%s" FILE_PATH_LOCK_EXTENSION, core_file_name);
|
sizeof(lock_filename));
|
||||||
|
strlcat(lock_filename, FILE_PATH_LOCK_EXTENSION,
|
||||||
|
sizeof(lock_filename));
|
||||||
|
|
||||||
hash = core_info_hash_string(lock_filename);
|
hash = core_info_hash_string(lock_filename);
|
||||||
|
|
||||||
@ -1508,14 +1493,13 @@ static bool core_info_path_is_standalone_exempt(
|
|||||||
uint32_t hash;
|
uint32_t hash;
|
||||||
char exempt_filename[NAME_MAX_LENGTH];
|
char exempt_filename[NAME_MAX_LENGTH];
|
||||||
|
|
||||||
exempt_filename[0] = '\0';
|
|
||||||
|
|
||||||
if (exempt_list->size < 1)
|
if (exempt_list->size < 1)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
snprintf(exempt_filename, sizeof(exempt_filename),
|
strlcpy(exempt_filename, core_file_name,
|
||||||
"%s" FILE_PATH_STANDALONE_EXEMPT_EXTENSION,
|
sizeof(exempt_filename));
|
||||||
core_file_name);
|
strlcat(exempt_filename, FILE_PATH_STANDALONE_EXEMPT_EXTENSION,
|
||||||
|
sizeof(exempt_filename));
|
||||||
|
|
||||||
hash = core_info_hash_string(exempt_filename);
|
hash = core_info_hash_string(exempt_filename);
|
||||||
|
|
||||||
@ -1564,8 +1548,6 @@ static core_info_t *core_info_find_internal(
|
|||||||
uint32_t hash;
|
uint32_t hash;
|
||||||
char core_file_id[256];
|
char core_file_id[256];
|
||||||
|
|
||||||
core_file_id[0] = '\0';
|
|
||||||
|
|
||||||
if (!list ||
|
if (!list ||
|
||||||
string_is_empty(core_path) ||
|
string_is_empty(core_path) ||
|
||||||
!core_info_get_file_id(path_basename_nocompression(core_path),
|
!core_info_get_file_id(path_basename_nocompression(core_path),
|
||||||
@ -1653,7 +1635,6 @@ static config_file_t *core_info_get_config_file(
|
|||||||
"%s" ".info", core_file_id);
|
"%s" ".info", core_file_id);
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
info_path[0] = '\0';
|
|
||||||
fill_pathname_join(info_path, info_dir, core_file_id,
|
fill_pathname_join(info_path, info_dir, core_file_id,
|
||||||
sizeof(info_path));
|
sizeof(info_path));
|
||||||
strlcat(info_path, ".info", sizeof(info_path));
|
strlcat(info_path, ".info", sizeof(info_path));
|
||||||
@ -2027,8 +2008,6 @@ static core_info_list_t *core_info_list_new(const char *path,
|
|||||||
config_file_t *conf = NULL;
|
config_file_t *conf = NULL;
|
||||||
char core_file_id[256];
|
char core_file_id[256];
|
||||||
|
|
||||||
core_file_id[0] = '\0';
|
|
||||||
|
|
||||||
if (!core_info_get_file_id(core_filename, core_file_id,
|
if (!core_info_get_file_id(core_filename, core_file_id,
|
||||||
sizeof(core_file_id)))
|
sizeof(core_file_id)))
|
||||||
continue;
|
continue;
|
||||||
@ -2496,9 +2475,6 @@ bool core_info_core_file_id_is_equal(const char *core_path_a,
|
|||||||
char core_file_id_a[256];
|
char core_file_id_a[256];
|
||||||
char core_file_id_b[256];
|
char core_file_id_b[256];
|
||||||
|
|
||||||
core_file_id_a[0] = '\0';
|
|
||||||
core_file_id_b[0] = '\0';
|
|
||||||
|
|
||||||
if ( string_is_empty(core_path_a)
|
if ( string_is_empty(core_path_a)
|
||||||
|| string_is_empty(core_path_b)
|
|| string_is_empty(core_path_b)
|
||||||
|| !core_info_get_file_id(
|
|| !core_info_get_file_id(
|
||||||
@ -2900,8 +2876,6 @@ bool core_info_set_core_lock(const char *core_path, bool lock)
|
|||||||
core_info_t *core_info = NULL;
|
core_info_t *core_info = NULL;
|
||||||
char lock_file_path[PATH_MAX_LENGTH];
|
char lock_file_path[PATH_MAX_LENGTH];
|
||||||
|
|
||||||
lock_file_path[0] = '\0';
|
|
||||||
|
|
||||||
#if defined(ANDROID)
|
#if defined(ANDROID)
|
||||||
/* Play Store builds do not support
|
/* Play Store builds do not support
|
||||||
* core locking */
|
* core locking */
|
||||||
@ -2916,8 +2890,8 @@ bool core_info_set_core_lock(const char *core_path, bool lock)
|
|||||||
return false;
|
return false;
|
||||||
|
|
||||||
/* Get lock file path */
|
/* Get lock file path */
|
||||||
snprintf(lock_file_path, sizeof(lock_file_path),
|
strlcpy(lock_file_path, core_info->path, sizeof(lock_file_path));
|
||||||
"%s" FILE_PATH_LOCK_EXTENSION, core_info->path);
|
strlcat(lock_file_path, FILE_PATH_LOCK_EXTENSION, sizeof(lock_file_path));
|
||||||
|
|
||||||
/* Create or delete lock file, as required */
|
/* Create or delete lock file, as required */
|
||||||
if (!core_info_update_core_aux_file(lock_file_path, lock))
|
if (!core_info_update_core_aux_file(lock_file_path, lock))
|
||||||
@ -2946,8 +2920,6 @@ bool core_info_get_core_lock(const char *core_path, bool validate_path)
|
|||||||
bool is_locked = false;
|
bool is_locked = false;
|
||||||
char lock_file_path[PATH_MAX_LENGTH];
|
char lock_file_path[PATH_MAX_LENGTH];
|
||||||
|
|
||||||
lock_file_path[0] = '\0';
|
|
||||||
|
|
||||||
#if defined(ANDROID)
|
#if defined(ANDROID)
|
||||||
/* Play Store builds do not support
|
/* Play Store builds do not support
|
||||||
* core locking */
|
* core locking */
|
||||||
@ -2973,8 +2945,10 @@ bool core_info_get_core_lock(const char *core_path, bool validate_path)
|
|||||||
return false;
|
return false;
|
||||||
|
|
||||||
/* Get lock file path */
|
/* Get lock file path */
|
||||||
snprintf(lock_file_path, sizeof(lock_file_path),
|
strlcpy(lock_file_path, core_file_path,
|
||||||
"%s" FILE_PATH_LOCK_EXTENSION, core_file_path);
|
sizeof(lock_file_path));
|
||||||
|
strlcat(lock_file_path, FILE_PATH_LOCK_EXTENSION,
|
||||||
|
sizeof(lock_file_path));
|
||||||
|
|
||||||
/* Check whether lock file exists */
|
/* Check whether lock file exists */
|
||||||
is_locked = path_is_valid(lock_file_path);
|
is_locked = path_is_valid(lock_file_path);
|
||||||
@ -3003,8 +2977,6 @@ bool core_info_set_core_standalone_exempt(const char *core_path, bool exempt)
|
|||||||
core_info_t *core_info = NULL;
|
core_info_t *core_info = NULL;
|
||||||
char exempt_file_path[PATH_MAX_LENGTH];
|
char exempt_file_path[PATH_MAX_LENGTH];
|
||||||
|
|
||||||
exempt_file_path[0] = '\0';
|
|
||||||
|
|
||||||
/* Search for specified core */
|
/* Search for specified core */
|
||||||
if (string_is_empty(core_path) ||
|
if (string_is_empty(core_path) ||
|
||||||
!core_info_find(core_path, &core_info) ||
|
!core_info_find(core_path, &core_info) ||
|
||||||
@ -3013,9 +2985,10 @@ bool core_info_set_core_standalone_exempt(const char *core_path, bool exempt)
|
|||||||
return false;
|
return false;
|
||||||
|
|
||||||
/* Get 'standalone exempt' file path */
|
/* Get 'standalone exempt' file path */
|
||||||
snprintf(exempt_file_path, sizeof(exempt_file_path),
|
strlcpy(exempt_file_path, core_info->path,
|
||||||
"%s" FILE_PATH_STANDALONE_EXEMPT_EXTENSION,
|
sizeof(exempt_file_path));
|
||||||
core_info->path);
|
strlcat(exempt_file_path, FILE_PATH_STANDALONE_EXEMPT_EXTENSION,
|
||||||
|
sizeof(exempt_file_path));
|
||||||
|
|
||||||
/* Create or delete 'standalone exempt' file, as required */
|
/* Create or delete 'standalone exempt' file, as required */
|
||||||
if (!core_info_update_core_aux_file(exempt_file_path, exempt))
|
if (!core_info_update_core_aux_file(exempt_file_path, exempt))
|
||||||
@ -3045,8 +3018,6 @@ bool core_info_get_core_standalone_exempt(const char *core_path)
|
|||||||
bool is_exempt = false;
|
bool is_exempt = false;
|
||||||
char exempt_file_path[PATH_MAX_LENGTH];
|
char exempt_file_path[PATH_MAX_LENGTH];
|
||||||
|
|
||||||
exempt_file_path[0] = '\0';
|
|
||||||
|
|
||||||
/* Search for specified core */
|
/* Search for specified core */
|
||||||
if (string_is_empty(core_path) ||
|
if (string_is_empty(core_path) ||
|
||||||
!core_info_find(core_path, &core_info) ||
|
!core_info_find(core_path, &core_info) ||
|
||||||
@ -3055,9 +3026,10 @@ bool core_info_get_core_standalone_exempt(const char *core_path)
|
|||||||
return false;
|
return false;
|
||||||
|
|
||||||
/* Get 'standalone exempt' file path */
|
/* Get 'standalone exempt' file path */
|
||||||
snprintf(exempt_file_path, sizeof(exempt_file_path),
|
strlcpy(exempt_file_path, core_info->path,
|
||||||
"%s" FILE_PATH_STANDALONE_EXEMPT_EXTENSION,
|
sizeof(exempt_file_path));
|
||||||
core_info->path);
|
strlcat(exempt_file_path, FILE_PATH_STANDALONE_EXEMPT_EXTENSION,
|
||||||
|
sizeof(exempt_file_path));
|
||||||
|
|
||||||
/* Check whether 'standalone exempt' file exists */
|
/* Check whether 'standalone exempt' file exists */
|
||||||
is_exempt = path_is_valid(exempt_file_path);
|
is_exempt = path_is_valid(exempt_file_path);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user