From 58cad13ba34765411daef859737370d9a86d7f13 Mon Sep 17 00:00:00 2001 From: zoltanvb Date: Wed, 11 Oct 2023 07:18:58 +0200 Subject: [PATCH] Move setlocale() closer to config file read/write. --- command.c | 2 ++ retroarch.c | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/command.c b/command.c index 5c07767f7171..7f58da374417 100644 --- a/command.c +++ b/command.c @@ -18,6 +18,7 @@ #include #include #include +#include #ifdef HAVE_NETWORKING #include #include @@ -1166,6 +1167,7 @@ bool command_event_save_config( const char *str = path_exists ? config_path : path_get(RARCH_PATH_CONFIG); + setlocale(LC_NUMERIC,"C"); if (path_exists && config_save_file(config_path)) { snprintf(s, len, "%s \"%s\".", diff --git a/retroarch.c b/retroarch.c index 472bbd4acd76..7d831d47b247 100644 --- a/retroarch.c +++ b/retroarch.c @@ -4857,7 +4857,6 @@ int rarch_main(int argc, char *argv[], void *data) command_event(CMD_EVENT_HISTORY_DEINIT, NULL); retroarch_favorites_deinit(); - setlocale(LC_NUMERIC,"C"); retroarch_config_init(); retroarch_deinit_drivers(&runloop_st->retro_ctx); @@ -5872,6 +5871,7 @@ static bool retroarch_parse_input_and_config( if (!(p_rarch->flags & RARCH_FLAGS_BLOCK_CONFIG_READ)) #endif { + setlocale(LC_NUMERIC,"C"); /* If this is a static build, load salamander * config file first (sets RARCH_PATH_CORE) */ #if !defined(HAVE_DYNAMIC)