From cedbcb10c6de93875832e3b3464abad929b59a6f Mon Sep 17 00:00:00 2001 From: libretroadmin Date: Mon, 25 Jul 2022 14:12:54 +0200 Subject: [PATCH] Take out some more unnecessary NULL string termination --- gfx/gfx_thumbnail_path.c | 11 ----------- gfx/video_shader_parse.c | 5 ++--- 2 files changed, 2 insertions(+), 14 deletions(-) diff --git a/gfx/gfx_thumbnail_path.c b/gfx/gfx_thumbnail_path.c index 04728d901e..1a537b1e41 100644 --- a/gfx/gfx_thumbnail_path.c +++ b/gfx/gfx_thumbnail_path.c @@ -295,9 +295,6 @@ bool gfx_thumbnail_set_system(gfx_thumbnail_path_data_t *path_data, * matches the database name */ char *playlist_name = NULL; char tmp[PATH_MAX_LENGTH]; - - tmp[0] = '\0'; - strlcpy(tmp, playlist_file, sizeof(tmp)); playlist_name = path_remove_extension(tmp); playlist_valid = string_is_equal(playlist_name, system); @@ -517,8 +514,6 @@ bool gfx_thumbnail_set_content_playlist( { char *db_name_no_ext = NULL; char tmp_buf[PATH_MAX_LENGTH]; - tmp_buf[0] = '\0'; - /* Remove .lpl extension * > path_remove_extension() requires a char * (not const) * so have to use a temporary buffer... */ @@ -580,7 +575,6 @@ bool gfx_thumbnail_update_path( return false; } - thumbnail_path[0] = '\0'; content_dir[0] = '\0'; if (settings) @@ -639,9 +633,6 @@ bool gfx_thumbnail_update_path( char tmp_buf[PATH_MAX_LENGTH]; const char *type = gfx_thumbnail_get_type(settings, path_data, thumbnail_id); - - tmp_buf[0] = '\0'; - /* > Normal content: assemble path */ /* >> Base + system name */ @@ -811,8 +802,6 @@ bool gfx_thumbnail_get_content_dir( if (!((path_length > 1) && (path_length < PATH_MAX_LENGTH))) return false; - tmp_buf[0] = '\0'; - strlcpy(tmp_buf, path_data->content_path, path_length * sizeof(char)); strlcpy(content_dir, path_basename_nocompression(tmp_buf), len); diff --git a/gfx/video_shader_parse.c b/gfx/video_shader_parse.c index 44854f8f0f..780704ba94 100644 --- a/gfx/video_shader_parse.c +++ b/gfx/video_shader_parse.c @@ -1633,10 +1633,9 @@ static bool override_shader_values(config_file_t *override_conf, * see if there is an entry for each in the override config */ for (i = 0; i < shader->num_parameters; i++) { - entry = config_get_entry(override_conf, shader->parameters[i].id); - /* If the parameter is in the reference config */ - if (entry) + if ((entry = config_get_entry( + override_conf, shader->parameters[i].id))) { struct video_shader_parameter *parameter = (struct video_shader_parameter*)