diff --git a/file_path_special.c b/file_path_special.c index d0ed5de396..635a5c2b73 100644 --- a/file_path_special.c +++ b/file_path_special.c @@ -169,19 +169,14 @@ void fill_pathname_application_special(char *s, #ifdef HAVE_XMB { char *s1 = (char*)malloc(PATH_MAX_LENGTH * sizeof(char)); - char *s2 = (char*)malloc(PATH_MAX_LENGTH * sizeof(char)); - s1[0] = s2[0] = '\0'; + s1[0] = '\0'; fill_pathname_application_special(s1, PATH_MAX_LENGTH * sizeof(char), APPLICATION_SPECIAL_DIRECTORY_ASSETS_XMB); - fill_pathname_join(s2, s1, "png", - PATH_MAX_LENGTH * sizeof(char) - ); - strlcpy(s, s2, len); + fill_pathname_join(s, s1, "png", len); free(s1); - free(s2); } #endif break; @@ -277,10 +272,9 @@ void fill_pathname_application_special(char *s, #ifdef HAVE_XMB { char *s1 = (char*)malloc(PATH_MAX_LENGTH * sizeof(char)); - char *s2 = (char*)malloc(PATH_MAX_LENGTH * sizeof(char)); settings_t *settings = config_get_ptr(); - s1[0] = s2[0] = '\0'; + s1[0] = '\0'; fill_pathname_join( s1, @@ -288,13 +282,9 @@ void fill_pathname_application_special(char *s, "xmb", PATH_MAX_LENGTH * sizeof(char) ); - fill_pathname_join(s2, - s1, xmb_theme_ident(), - PATH_MAX_LENGTH * sizeof(char) - ); - strlcpy(s, s2, len); + fill_pathname_join(s, + s1, xmb_theme_ident(), len); free(s1); - free(s2); } #endif break; @@ -370,45 +360,35 @@ void fill_pathname_application_special(char *s, break; case APPLICATION_SPECIAL_DIRECTORY_THUMBNAILS_DISCORD_AVATARS: { - char *s1 = (char*)malloc(PATH_MAX_LENGTH * sizeof(char)); - char *s2 = (char*)malloc(PATH_MAX_LENGTH * sizeof(char)); - settings_t *settings = config_get_ptr(); + char *s1 = (char*)malloc(PATH_MAX_LENGTH * sizeof(char)); + settings_t *settings = config_get_ptr(); - s1[0] = s2[0] = '\0'; + s1[0] = '\0'; fill_pathname_join(s1, settings->paths.directory_thumbnails, "discord", len); - fill_pathname_join(s2, - s1, "avatars", - PATH_MAX_LENGTH * sizeof(char) - ); - strlcpy(s, s2, len); + fill_pathname_join(s, + s1, "avatars", len); free(s1); - free(s2); } break; case APPLICATION_SPECIAL_DIRECTORY_THUMBNAILS_CHEEVOS_BADGES: { - char *s1 = (char*)malloc(PATH_MAX_LENGTH * sizeof(char)); - char *s2 = (char*)malloc(PATH_MAX_LENGTH * sizeof(char)); - settings_t *settings = config_get_ptr(); + char *s1 = (char*)malloc(PATH_MAX_LENGTH * sizeof(char)); + settings_t *settings = config_get_ptr(); - s1[0] = s2[0] = '\0'; + s1[0] = '\0'; fill_pathname_join(s1, settings->paths.directory_thumbnails, "cheevos", len); - fill_pathname_join(s2, - s1, "badges", - PATH_MAX_LENGTH * sizeof(char) - ); - strlcpy(s, s2, len); + fill_pathname_join(s, + s1, "badges", len); free(s1); - free(s2); } break;