aboutsummaryrefslogtreecommitdiff
path: root/src/util/amount.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2023-05-10 01:01:37 +0200
committerChristian Grothoff <christian@grothoff.org>2023-05-10 01:01:37 +0200
commitc014acf3c4ccf03109b0141d6b68d4f464464e19 (patch)
tree936413646c36985cffeb0da81f4f71d27422c48d /src/util/amount.c
parent3ebd0a70b2bba2e64615c0973477a610e117c97a (diff)
always use GNUNET_memcpy
Diffstat (limited to 'src/util/amount.c')
-rw-r--r--src/util/amount.c30
1 files changed, 15 insertions, 15 deletions
diff --git a/src/util/amount.c b/src/util/amount.c
index d5698e8b6..dfe10b07e 100644
--- a/src/util/amount.c
+++ b/src/util/amount.c
@@ -72,9 +72,9 @@ TALER_string_to_amount (const char *str,
}
GNUNET_assert (TALER_CURRENCY_LEN > (colon - str));
- memcpy (amount->currency,
- str,
- colon - str);
+ GNUNET_memcpy (amount->currency,
+ str,
+ colon - str);
/* 0-terminate *and* normalize buffer by setting everything to '\0' */
memset (&amount->currency [colon - str],
0,
@@ -193,9 +193,9 @@ TALER_amount_hton (struct TALER_AmountNBO *res,
TALER_amount_is_valid (d));
res->value = GNUNET_htonll (d->value);
res->fraction = htonl (d->fraction);
- memcpy (res->currency,
- d->currency,
- TALER_CURRENCY_LEN);
+ GNUNET_memcpy (res->currency,
+ d->currency,
+ TALER_CURRENCY_LEN);
}
@@ -205,9 +205,9 @@ TALER_amount_ntoh (struct TALER_Amount *res,
{
res->value = GNUNET_ntohll (dn->value);
res->fraction = ntohl (dn->fraction);
- memcpy (res->currency,
- dn->currency,
- TALER_CURRENCY_LEN);
+ GNUNET_memcpy (res->currency,
+ dn->currency,
+ TALER_CURRENCY_LEN);
GNUNET_assert (GNUNET_YES ==
TALER_amount_is_valid (res));
}
@@ -225,9 +225,9 @@ TALER_amount_set_zero (const char *cur,
memset (amount,
0,
sizeof (struct TALER_Amount));
- memcpy (amount->currency,
- cur,
- slen);
+ GNUNET_memcpy (amount->currency,
+ cur,
+ slen);
return GNUNET_OK;
}
@@ -680,9 +680,9 @@ TALER_amount_multiply (struct TALER_Amount *result,
if (GNUNET_SYSERR ==
TALER_amount_normalize (&in))
return TALER_AAR_INVALID_NORMALIZATION_FAILED;
- memcpy (result->currency,
- amount->currency,
- TALER_CURRENCY_LEN);
+ GNUNET_memcpy (result->currency,
+ amount->currency,
+ TALER_CURRENCY_LEN);
if ( (0 == factor) ||
( (0 == in.value) &&
(0 == in.fraction) ) )