From 85c4a29d3883c86f5ca7f0f8e1fd8c2dd9954cb3 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Mon, 22 Apr 2019 08:13:26 +0200 Subject: [PATCH] Simplify config_save_autoconf_profile --- configuration.c | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/configuration.c b/configuration.c index f3a30cd0c1..fa2d9f7c9a 100644 --- a/configuration.c +++ b/configuration.c @@ -3741,8 +3741,6 @@ void config_load(void) bool config_save_autoconf_profile(const char *path, unsigned user) { unsigned i; - char *buf = NULL; - char *autoconf_file = NULL; char *path_new = NULL; config_file_t *conf = NULL; size_t path_size = PATH_MAX_LENGTH * sizeof(char); @@ -3752,16 +3750,12 @@ bool config_save_autoconf_profile(const char *path, unsigned user) settings_t *settings = config_get_ptr(); const char *autoconf_dir = settings->paths.directory_autoconfig; const char *joypad_ident = settings->arrays.input_joypad_driver; - - if (string_is_empty(path)) - return false; - - buf = (char*) + char *buf = (char*) malloc(PATH_MAX_LENGTH * sizeof(char)); - autoconf_file = (char*) + char *autoconf_file = (char*) malloc(PATH_MAX_LENGTH * sizeof(char)); + char *path_new = strdup(path); buf[0] = autoconf_file[0] = '\0'; - path_new = strdup(path); for (i = 0; invalid_filename_chars[i]; i++) {