diff options
author | Christian Grothoff <grothoff@gnunet.org> | 2021-07-28 09:45:33 +0200 |
---|---|---|
committer | Christian Grothoff <grothoff@gnunet.org> | 2021-07-28 09:45:33 +0200 |
commit | b9e4431ae6d6075bc0af8ab3bad7b976d831c8f0 (patch) | |
tree | 88327c4e1b8238f745a1643d8f4b0eb8fd07dff4 | |
parent | 6516f1899f4202d802901d08ce26d02db63af83f (diff) | |
download | exchange-b9e4431ae6d6075bc0af8ab3bad7b976d831c8f0.tar.gz exchange-b9e4431ae6d6075bc0af8ab3bad7b976d831c8f0.zip |
-fix amount packer
-rw-r--r-- | src/json/json_pack.c | 20 |
1 files changed, 10 insertions, 10 deletions
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 | |||
88 | TALER_JSON_pack_amount (const char *name, | 88 | TALER_JSON_pack_amount (const char *name, |
89 | const struct TALER_Amount *amount) | 89 | const struct TALER_Amount *amount) |
90 | { | 90 | { |
91 | json_t *json; | 91 | struct GNUNET_JSON_PackSpec ps = { |
92 | .field_name = name, | ||
93 | .object = TALER_JSON_from_amount (amount) | ||
94 | }; | ||
92 | 95 | ||
93 | json = TALER_JSON_from_amount (amount); | 96 | return ps; |
94 | GNUNET_assert (NULL != json); | ||
95 | return GNUNET_JSON_pack_object_steal (name, | ||
96 | json); | ||
97 | } | 97 | } |
98 | 98 | ||
99 | 99 | ||
@@ -101,12 +101,12 @@ struct GNUNET_JSON_PackSpec | |||
101 | TALER_JSON_pack_amount_nbo (const char *name, | 101 | TALER_JSON_pack_amount_nbo (const char *name, |
102 | const struct TALER_AmountNBO *amount) | 102 | const struct TALER_AmountNBO *amount) |
103 | { | 103 | { |
104 | json_t *json; | 104 | struct GNUNET_JSON_PackSpec ps = { |
105 | .field_name = name, | ||
106 | .object = TALER_JSON_from_amount_nbo (amount) | ||
107 | }; | ||
105 | 108 | ||
106 | json = TALER_JSON_from_amount_nbo (amount); | 109 | return ps; |
107 | GNUNET_assert (NULL != json); | ||
108 | return GNUNET_JSON_pack_object_steal (name, | ||
109 | json); | ||
110 | } | 110 | } |
111 | 111 | ||
112 | 112 | ||