(libretro-common) don't do implicit memset

This commit is contained in:
twinaphex 2016-10-08 20:04:48 +02:00
parent 9895ae0247
commit 5f5571e241
2 changed files with 16 additions and 6 deletions

View File

@ -232,10 +232,12 @@ static int file_archive_extract_cb(const char *name, const char *valid_exts,
/* Extract first file that matches our list. */
if (ext && string_list_find_elem(userdata->ext, ext))
{
char new_path[PATH_MAX_LENGTH] = {0};
char wanted_file[PATH_MAX_LENGTH] = {0};
char new_path[PATH_MAX_LENGTH];
char wanted_file[PATH_MAX_LENGTH];
const char *delim = NULL;
new_path[0] = wanted_file[0] = '\0';
if (userdata->extraction_directory)
fill_pathname_join(new_path, userdata->extraction_directory,
path_basename(name), sizeof(new_path));
@ -754,9 +756,11 @@ const struct file_archive_file_backend *file_archive_get_7z_file_backend(void)
const struct file_archive_file_backend* file_archive_get_file_backend(const char *path)
{
char newpath[PATH_MAX_LENGTH];
const char *file_ext = NULL;
char *last = NULL;
char newpath[PATH_MAX_LENGTH] = {0};
newpath[0] = '\0';
strlcpy(newpath, path, sizeof(newpath));

View File

@ -257,9 +257,11 @@ bool path_file_exists(const char *path)
void fill_pathname(char *out_path, const char *in_path,
const char *replace, size_t size)
{
char tmp_path[PATH_MAX_LENGTH] = {0};
char tmp_path[PATH_MAX_LENGTH];
char *tok = NULL;
tmp_path[0] = '\0';
retro_assert(strlcpy(tmp_path, in_path,
sizeof(tmp_path)) < sizeof(tmp_path));
if ((tok = (char*)strrchr(path_basename(tmp_path), '.')))
@ -575,7 +577,9 @@ bool path_is_absolute(const char *path)
void path_resolve_realpath(char *buf, size_t size)
{
#ifndef RARCH_CONSOLE
char tmp[PATH_MAX_LENGTH] = {0};
char tmp[PATH_MAX_LENGTH];
tmp[0] = '\0';
strlcpy(tmp, buf, sizeof(tmp));
@ -728,11 +732,13 @@ void fill_pathname_join_delim_concat(char *out_path, const char *dir,
void fill_short_pathname_representation(char* out_rep,
const char *in_path, size_t size)
{
char path_short[PATH_MAX_LENGTH] = {0};
char path_short[PATH_MAX_LENGTH];
#ifdef HAVE_COMPRESSION
char *last_slash = NULL;
#endif
path_short[0] = '\0';
fill_pathname(path_short, path_basename(in_path), "",
sizeof(path_short));