Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Set fixed locale for numbers, close to config read/write
Browse files Browse the repository at this point in the history
Move setlocale() closer to config file read/write.
zoltanvb committed Oct 15, 2023
1 parent 6e1dc98 commit 6431eff
Showing 2 changed files with 3 additions and 0 deletions.
2 changes: 2 additions & 0 deletions command.c
Original file line number Diff line number Diff line change
@@ -18,6 +18,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <stddef.h>
#include <locale.h>
#ifdef HAVE_NETWORKING
#include <net/net_compat.h>
#include <net/net_socket.h>
@@ -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\".",
1 change: 1 addition & 0 deletions retroarch.c
Original file line number Diff line number Diff line change
@@ -5871,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)

0 comments on commit 6431eff

Please sign in to comment.