From e5f9c4d7132565fa329ed9832a05bddc03ff8094 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Tue, 27 Dec 2016 03:19:07 +0100 Subject: [PATCH] command_event_save_config - check if config_path is empty --- command.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/command.c b/command.c index 46e60c4a19..bbd6bc321b 100644 --- a/command.c +++ b/command.c @@ -1467,21 +1467,21 @@ static bool command_event_save_auto_state(void) static bool command_event_save_config(const char *config_path, char *s, size_t len) { - if (config_save_file(config_path)) + if (string_is_empty(config_path) || !config_save_file(config_path)) { snprintf(s, len, "%s \"%s\".", - msg_hash_to_str(MSG_SAVED_NEW_CONFIG_TO), + msg_hash_to_str(MSG_FAILED_SAVING_CONFIG_TO), path_get(RARCH_PATH_CONFIG)); - RARCH_LOG("%s\n", s); - return true; + RARCH_ERR("%s\n", s); + + return false; } snprintf(s, len, "%s \"%s\".", - msg_hash_to_str(MSG_FAILED_SAVING_CONFIG_TO), + msg_hash_to_str(MSG_SAVED_NEW_CONFIG_TO), path_get(RARCH_PATH_CONFIG)); - RARCH_ERR("%s\n", s); - - return false; + RARCH_LOG("%s\n", s); + return true; } /**