Prevent some more implicit memsets

This commit is contained in:
twinaphex 2016-10-18 04:15:24 +02:00
parent d1b90a8b6d
commit 584d9a5997
3 changed files with 21 additions and 6 deletions

View File

@ -128,8 +128,13 @@ static void nk_menu_context_reset_textures(nk_menu_handle_t *nk,
for (i = 0; i < NK_TEXTURE_LAST; i++)
{
struct texture_image ti = {0};
char path[PATH_MAX_LENGTH] = {0};
struct texture_image ti;
char path[PATH_MAX_LENGTH];
ti.width = 0;
ti.height = 0;
ti.pixels = NULL;
path[0] = '\0';
switch(i)
{

View File

@ -1450,7 +1450,7 @@ static void xmb_context_reset_horizontal_list(
char sysname[PATH_MAX_LENGTH];
char texturepath[PATH_MAX_LENGTH];
char content_texturepath[PATH_MAX_LENGTH];
struct texture_image ti = {0};
struct texture_image ti;
const char *path = NULL;
xmb_node_t *node =
xmb_get_userdata_from_horizontal_list(xmb, i);
@ -1483,6 +1483,10 @@ static void xmb_context_reset_horizontal_list(
file_path_str(FILE_PATH_PNG_EXTENSION),
sizeof(texturepath));
ti.width = 0;
ti.height = 0;
ti.pixels = NULL;
if (image_texture_load(&ti, texturepath))
{
if(ti.pixels)

View File

@ -844,10 +844,16 @@ void menu_display_set_alpha(float *color, float alpha_value)
void menu_display_reset_textures_list(const char *texture_path, const char *iconpath,
uintptr_t *item)
{
struct texture_image ti = {0};
char path[PATH_MAX_LENGTH] = {0};
struct texture_image ti;
char path[PATH_MAX_LENGTH];
if (texture_path != NULL)
path[0] = '\0';
ti.width = 0;
ti.height = 0;
ti.pixels = NULL;
if (!string_is_empty(texture_path))
fill_pathname_join(path, iconpath, texture_path, sizeof(path));
if (string_is_empty(path) || !path_file_exists(path))