gnunet-svn
[Top][All Lists]
Advanced

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

[taler-exchange] branch master updated: ensure amounts are in upper-case


From: gnunet
Subject: [taler-exchange] branch master updated: ensure amounts are in upper-case
Date: Wed, 10 May 2023 09:16:49 +0200

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

grothoff pushed a commit to branch master
in repository exchange.

The following commit(s) were added to refs/heads/master by this push:
     new 49549634 ensure amounts are in upper-case
49549634 is described below

commit 495496340554ec4699e9dbc561d921b242c92e6d
Author: Christian Grothoff <christian@grothoff.org>
AuthorDate: Wed May 10 09:13:09 2023 +0200

    ensure amounts are in upper-case
---
 src/util/amount.c | 15 ++++++---------
 1 file changed, 6 insertions(+), 9 deletions(-)

diff --git a/src/util/amount.c b/src/util/amount.c
index dfe10b07..9cd0739c 100644
--- a/src/util/amount.c
+++ b/src/util/amount.c
@@ -72,9 +72,8 @@ TALER_string_to_amount (const char *str,
   }
 
   GNUNET_assert (TALER_CURRENCY_LEN > (colon - str));
-  GNUNET_memcpy (amount->currency,
-                 str,
-                 colon - str);
+  for (unsigned int i = 0; i<colon - str; i++)
+    amount->currency[i] = toupper (str[i]);
   /* 0-terminate *and* normalize buffer by setting everything to '\0' */
   memset (&amount->currency [colon - str],
           0,
@@ -193,9 +192,8 @@ TALER_amount_hton (struct TALER_AmountNBO *res,
                  TALER_amount_is_valid (d));
   res->value = GNUNET_htonll (d->value);
   res->fraction = htonl (d->fraction);
-  GNUNET_memcpy (res->currency,
-                 d->currency,
-                 TALER_CURRENCY_LEN);
+  for (unsigned int i = 0; i<TALER_CURRENCY_LEN; i++)
+    res->currency[i] = toupper (d->currency[i]);
 }
 
 
@@ -225,9 +223,8 @@ TALER_amount_set_zero (const char *cur,
   memset (amount,
           0,
           sizeof (struct TALER_Amount));
-  GNUNET_memcpy (amount->currency,
-                 cur,
-                 slen);
+  for (unsigned int i = 0; i<slen; i++)
+    amount->currency[i] = toupper (cur[i]);
   return GNUNET_OK;
 }
 

-- 
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]