mirror of
https://github.com/libretro/RetroArch
synced 2025-04-09 21:45:45 +00:00
(libretro-common) don't do implicit memset
This commit is contained in:
parent
9895ae0247
commit
5f5571e241
@ -232,10 +232,12 @@ static int file_archive_extract_cb(const char *name, const char *valid_exts,
|
|||||||
/* Extract first file that matches our list. */
|
/* Extract first file that matches our list. */
|
||||||
if (ext && string_list_find_elem(userdata->ext, ext))
|
if (ext && string_list_find_elem(userdata->ext, ext))
|
||||||
{
|
{
|
||||||
char new_path[PATH_MAX_LENGTH] = {0};
|
char new_path[PATH_MAX_LENGTH];
|
||||||
char wanted_file[PATH_MAX_LENGTH] = {0};
|
char wanted_file[PATH_MAX_LENGTH];
|
||||||
const char *delim = NULL;
|
const char *delim = NULL;
|
||||||
|
|
||||||
|
new_path[0] = wanted_file[0] = '\0';
|
||||||
|
|
||||||
if (userdata->extraction_directory)
|
if (userdata->extraction_directory)
|
||||||
fill_pathname_join(new_path, userdata->extraction_directory,
|
fill_pathname_join(new_path, userdata->extraction_directory,
|
||||||
path_basename(name), sizeof(new_path));
|
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)
|
const struct file_archive_file_backend* file_archive_get_file_backend(const char *path)
|
||||||
{
|
{
|
||||||
|
char newpath[PATH_MAX_LENGTH];
|
||||||
const char *file_ext = NULL;
|
const char *file_ext = NULL;
|
||||||
char *last = NULL;
|
char *last = NULL;
|
||||||
char newpath[PATH_MAX_LENGTH] = {0};
|
|
||||||
|
newpath[0] = '\0';
|
||||||
|
|
||||||
strlcpy(newpath, path, sizeof(newpath));
|
strlcpy(newpath, path, sizeof(newpath));
|
||||||
|
|
||||||
|
@ -257,9 +257,11 @@ bool path_file_exists(const char *path)
|
|||||||
void fill_pathname(char *out_path, const char *in_path,
|
void fill_pathname(char *out_path, const char *in_path,
|
||||||
const char *replace, size_t size)
|
const char *replace, size_t size)
|
||||||
{
|
{
|
||||||
char tmp_path[PATH_MAX_LENGTH] = {0};
|
char tmp_path[PATH_MAX_LENGTH];
|
||||||
char *tok = NULL;
|
char *tok = NULL;
|
||||||
|
|
||||||
|
tmp_path[0] = '\0';
|
||||||
|
|
||||||
retro_assert(strlcpy(tmp_path, in_path,
|
retro_assert(strlcpy(tmp_path, in_path,
|
||||||
sizeof(tmp_path)) < sizeof(tmp_path));
|
sizeof(tmp_path)) < sizeof(tmp_path));
|
||||||
if ((tok = (char*)strrchr(path_basename(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)
|
void path_resolve_realpath(char *buf, size_t size)
|
||||||
{
|
{
|
||||||
#ifndef RARCH_CONSOLE
|
#ifndef RARCH_CONSOLE
|
||||||
char tmp[PATH_MAX_LENGTH] = {0};
|
char tmp[PATH_MAX_LENGTH];
|
||||||
|
|
||||||
|
tmp[0] = '\0';
|
||||||
|
|
||||||
strlcpy(tmp, buf, sizeof(tmp));
|
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,
|
void fill_short_pathname_representation(char* out_rep,
|
||||||
const char *in_path, size_t size)
|
const char *in_path, size_t size)
|
||||||
{
|
{
|
||||||
char path_short[PATH_MAX_LENGTH] = {0};
|
char path_short[PATH_MAX_LENGTH];
|
||||||
#ifdef HAVE_COMPRESSION
|
#ifdef HAVE_COMPRESSION
|
||||||
char *last_slash = NULL;
|
char *last_slash = NULL;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
path_short[0] = '\0';
|
||||||
|
|
||||||
fill_pathname(path_short, path_basename(in_path), "",
|
fill_pathname(path_short, path_basename(in_path), "",
|
||||||
sizeof(path_short));
|
sizeof(path_short));
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user