From b9e4431ae6d6075bc0af8ab3bad7b976d831c8f0 Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Wed, 28 Jul 2021 09:45:33 +0200 Subject: -fix amount packer --- src/json/json_pack.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'src') diff --git a/src/json/json_pack.c b/src/json/json_pack.c index 836f03911..7a5d22ee2 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; } -- cgit v1.2.3