gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[gnunet] branch master updated: util: Fix portability for uselocale; fi


From: gnunet
Subject: [gnunet] branch master updated: util: Fix portability for uselocale; fix actually setting the locale
Date: Mon, 09 Dec 2024 14:46:55 +0100

This is an automated email from the git hooks/post-receive script.

martin-schanzenbach pushed a commit to branch master
in repository gnunet.

The following commit(s) were added to refs/heads/master by this push:
     new 5897254fc util: Fix portability for uselocale; fix actually setting 
the locale
5897254fc is described below

commit 5897254fca8049507a80dd3a9ae73accb3bd0f2c
Author: Martin Schanzenbach <schanzen@gnunet.org>
AuthorDate: Mon Dec 9 14:46:47 2024 +0100

    util: Fix portability for uselocale; fix actually setting the locale
---
 src/include/platform.h       | 1 +
 src/lib/util/configuration.c | 4 ++--
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/include/platform.h b/src/include/platform.h
index c04d8d487..30bbbe295 100644
--- a/src/include/platform.h
+++ b/src/include/platform.h
@@ -124,6 +124,7 @@
 #include <dlfcn.h>
 #include <semaphore.h>
 #include <net/if.h>
+#include <xlocale.h>
 #endif
 #if defined(__linux__) || defined(GNU)
 #include <net/if.h>
diff --git a/src/lib/util/configuration.c b/src/lib/util/configuration.c
index 0eaea6a88..f5250cb40 100644
--- a/src/lib/util/configuration.c
+++ b/src/lib/util/configuration.c
@@ -1721,7 +1721,7 @@ GNUNET_CONFIGURATION_set_value_float (struct 
GNUNET_CONFIGURATION_Handle *cfg,
 
   // TODO FIXME note that this truncates the float
   // #9369
-  const locale_t cl = newlocale(0, "C", (locale_t)0);
+  const locale_t cl = newlocale(LC_NUMERIC_MASK, "C", (locale_t)0);
   locale_t old_locale = uselocale(cl);
   GNUNET_snprintf (s,
                    64,
@@ -1752,7 +1752,7 @@ GNUNET_CONFIGURATION_get_value_float (
   if (NULL == e->val)
     return GNUNET_NO;
   // #9369
-  const locale_t cl = newlocale(0, "C", (locale_t)0);
+  const locale_t cl = newlocale(LC_NUMERIC_MASK, "C", (locale_t)0);
   locale_t old_locale = uselocale(cl);
   if (1 != sscanf (e->val,
                    "%f%1s",

-- 
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]