[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[gnunet] 02/03: -fix compiler warning
From: |
gnunet |
Subject: |
[gnunet] 02/03: -fix compiler warning |
Date: |
Fri, 03 Jan 2025 11:53:17 +0100 |
This is an automated email from the git hooks/post-receive script.
grothoff pushed a commit to branch master
in repository gnunet.
commit 71c34749f723aebcec9305ca0550e7499eadb4d0
Author: Christian Grothoff <christian@grothoff.org>
AuthorDate: Fri Jan 3 11:52:54 2025 +0100
-fix compiler warning
---
src/lib/util/configuration.c | 32 +++++++++++++++++++-------------
1 file changed, 19 insertions(+), 13 deletions(-)
diff --git a/src/lib/util/configuration.c b/src/lib/util/configuration.c
index 3759af86f..5bee5418c 100644
--- a/src/lib/util/configuration.c
+++ b/src/lib/util/configuration.c
@@ -1797,14 +1797,15 @@ GNUNET_CONFIGURATION_set_value_float (struct
GNUNET_CONFIGURATION_Handle *cfg,
{
char s[64];
- // TODO FIXME note that this truncates the float
- // #9369
- const locale_t cl = newlocale (LC_NUMERIC_MASK, "C", (locale_t) 0);
+ /* See: #9369 */
+ const locale_t cl = newlocale (LC_NUMERIC_MASK,
+ "C",
+ (locale_t) 0);
locale_t old_locale = uselocale (cl);
GNUNET_snprintf (s,
64,
"%f",
- number);
+ (double) number);
uselocale (old_locale);
GNUNET_CONFIGURATION_set_value_string (cfg,
section,
@@ -1829,15 +1830,20 @@ GNUNET_CONFIGURATION_get_value_float (
return GNUNET_NO;
if (NULL == e->val)
return GNUNET_NO;
- // #9369
- 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",
- number,
- dummy))
- return GNUNET_SYSERR;
- uselocale (old_locale);
+ /* See #9369 */
+ {
+ 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",
+ number,
+ dummy))
+ return GNUNET_SYSERR;
+ uselocale (old_locale);
+ }
return GNUNET_OK;
}
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.