(General) Cleanups

This commit is contained in:
twinaphex 2015-06-13 03:06:11 +02:00
parent 7197b58ed6
commit 3417d98405
3 changed files with 15 additions and 8 deletions

View File

@ -87,7 +87,9 @@ static void core_info_list_resolve_all_firmware(
for (c = 0; c < count; c++)
{
char path_key[64], desc_key[64], opt_key[64];
char path_key[64] = {0};
char desc_key[64] = {0};
char opt_key[64] = {0};
snprintf(path_key, sizeof(path_key), "firmware%u_path", c);
snprintf(desc_key, sizeof(desc_key), "firmware%u_desc", c);
@ -124,7 +126,9 @@ void core_info_get_name(const char *path, char *s, size_t len)
for (i = 0; i < contents->size; i++)
{
char info_path_base[PATH_MAX_LENGTH], info_path[PATH_MAX_LENGTH];
char info_path_base[PATH_MAX_LENGTH] = {0};
char info_path[PATH_MAX_LENGTH] = {0};
core_info[i].path = strdup(contents->elems[i].data);
if (!core_info[i].path)
@ -189,7 +193,8 @@ core_info_list_t *core_info_list_new(void)
for (i = 0; i < contents->size; i++)
{
char info_path_base[PATH_MAX_LENGTH], info_path[PATH_MAX_LENGTH];
char info_path_base[PATH_MAX_LENGTH] = {0};
char info_path[PATH_MAX_LENGTH] = {0};
core_info[i].path = strdup(contents->elems[i].data);
if (!core_info[i].path)
@ -527,8 +532,8 @@ void core_info_list_update_missing_firmware(core_info_list_t *core_info_list,
const char *core, const char *systemdir)
{
size_t i;
char path[PATH_MAX_LENGTH];
core_info_t *info = NULL;
char path[PATH_MAX_LENGTH] = {0};
core_info_t *info = NULL;
if (!core_info_list || !core)
return;
@ -552,8 +557,8 @@ void core_info_list_get_missing_firmware(core_info_list_t *core_info_list,
const core_info_firmware_t **firmware, size_t *num_firmware)
{
size_t i;
char path[PATH_MAX_LENGTH];
core_info_t *info = NULL;
char path[PATH_MAX_LENGTH] = {0};
core_info_t *info = NULL;
if (!core_info_list || !core)
return;

View File

@ -611,6 +611,7 @@ static void log_connection(const struct sockaddr_storage *their_addr,
if (str)
{
char msg[512] = {0};
snprintf(msg, sizeof(msg), "Got connection from: \"%s (%s)\" (#%u)",
nick, str, slot);
rarch_main_msg_queue_push(msg, 1, 180, false);

View File

@ -850,7 +850,8 @@ static void rarch_init_savefile_paths(void)
for (j = 0; j < info->roms[i].num_memory; j++)
{
union string_list_elem_attr attr;
char path[PATH_MAX_LENGTH], ext[32];
char path[PATH_MAX_LENGTH] = {0};
char ext[32] = {0};
const struct retro_subsystem_memory_info *mem =
(const struct retro_subsystem_memory_info*)
&info->roms[i].memory[j];