summaryrefslogtreecommitdiff
path: root/src/json/json_pack.c
diff options
context:
space:
mode:
authorChristian Grothoff <grothoff@gnunet.org>2021-07-28 09:45:33 +0200
committerChristian Grothoff <grothoff@gnunet.org>2021-07-28 09:45:33 +0200
commitb9e4431ae6d6075bc0af8ab3bad7b976d831c8f0 (patch)
tree88327c4e1b8238f745a1643d8f4b0eb8fd07dff4 /src/json/json_pack.c
parent6516f1899f4202d802901d08ce26d02db63af83f (diff)
downloadexchange-b9e4431ae6d6075bc0af8ab3bad7b976d831c8f0.tar.gz
exchange-b9e4431ae6d6075bc0af8ab3bad7b976d831c8f0.tar.bz2
exchange-b9e4431ae6d6075bc0af8ab3bad7b976d831c8f0.zip
-fix amount packer
Diffstat (limited to 'src/json/json_pack.c')
-rw-r--r--src/json/json_pack.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/json/json_pack.c b/src/json/json_pack.c
index 836f0391..7a5d22ee 100644
--- a/src/json/json_pack.c
+++ b/src/json/json_pack.c
@@ -88,12 +88,12 @@ struct GNUNET_JSON_PackSpec
TALER_JSON_pack_amount (const char *name,
const struct TALER_Amount *amount)
{
- json_t *json;
+ struct GNUNET_JSON_PackSpec ps = {
+ .field_name = name,
+ .object = TALER_JSON_from_amount (amount)
+ };
- json = TALER_JSON_from_amount (amount);
- GNUNET_assert (NULL != json);
- return GNUNET_JSON_pack_object_steal (name,
- json);
+ return ps;
}
@@ -101,12 +101,12 @@ struct GNUNET_JSON_PackSpec
TALER_JSON_pack_amount_nbo (const char *name,
const struct TALER_AmountNBO *amount)
{
- json_t *json;
+ struct GNUNET_JSON_PackSpec ps = {
+ .field_name = name,
+ .object = TALER_JSON_from_amount_nbo (amount)
+ };
- json = TALER_JSON_from_amount_nbo (amount);
- GNUNET_assert (NULL != json);
- return GNUNET_JSON_pack_object_steal (name,
- json);
+ return ps;
}