commit 24a97957451a6580ddf3d533834c4088414adcfc
parent a702c5d080167125203a10e297247a9276e91432
Author: Christian Grothoff <christian@grothoff.org>
Date: Mon, 6 Oct 2025 20:44:28 +0200
-nicer indentation
Diffstat:
1 file changed, 15 insertions(+), 14 deletions(-)
diff --git a/src/util/contract_parse.c b/src/util/contract_parse.c
@@ -373,7 +373,6 @@ parse_choices (
struct TALER_MERCHANT_ContractChoice *choice = &(*choices)[i];
const json_t *jinputs;
const json_t *joutputs;
-
struct GNUNET_JSON_Specification spec[] = {
TALER_JSON_spec_amount_any ("amount",
&choice->amount),
@@ -393,7 +392,6 @@ parse_choices (
&joutputs),
GNUNET_JSON_spec_end ()
};
-
const char *ename;
unsigned int eline;
@@ -415,6 +413,7 @@ parse_choices (
{
const json_t *jinput;
size_t idx;
+
json_array_foreach ((json_t *) jinputs, idx, jinput)
{
struct TALER_MERCHANT_ContractInput input = {
@@ -426,8 +425,10 @@ parse_choices (
&input,
idx,
false))
+ {
+ GNUNET_break (0);
return GNUNET_SYSERR;
-
+ }
switch (input.type)
{
case TALER_MERCHANT_CONTRACT_INPUT_TYPE_INVALID:
@@ -439,7 +440,6 @@ parse_choices (
continue;
break;
}
-
GNUNET_array_append (choice->inputs,
choice->inputs_len,
input);
@@ -460,8 +460,10 @@ parse_choices (
&output,
idx,
false))
+ {
+ GNUNET_break (0);
return GNUNET_SYSERR;
-
+ }
switch (output.type)
{
case TALER_MERCHANT_CONTRACT_OUTPUT_TYPE_INVALID:
@@ -475,7 +477,6 @@ parse_choices (
case TALER_MERCHANT_CONTRACT_OUTPUT_TYPE_DONATION_RECEIPT:
break;
}
-
GNUNET_array_append (choice->outputs,
choice->outputs_len,
output);
@@ -1060,13 +1061,14 @@ parse_contract_v1 (
struct TALER_MERCHANT_Contract *contract)
{
struct GNUNET_JSON_Specification espec[] = {
- spec_choices ("choices",
- &contract->details.v1.choices,
- &contract->details.v1.choices_len),
- spec_token_families ("token_families",
- &contract->details.v1.token_authorities,
- &contract->details.v1.
- token_authorities_len),
+ spec_choices (
+ "choices",
+ &contract->details.v1.choices,
+ &contract->details.v1.choices_len),
+ spec_token_families (
+ "token_families",
+ &contract->details.v1.token_authorities,
+ &contract->details.v1.token_authorities_len),
GNUNET_JSON_spec_end ()
};
@@ -1078,7 +1080,6 @@ parse_contract_v1 (
espec,
&ename,
&eline);
-
if (GNUNET_OK != res)
{
GNUNET_break (0);