commit ad09066a8ef65c054b8bd2718b74c038ab139886
parent 219dfe1fcdfc848884856bd062d4c4a06c22a12c
Author: Christian Grothoff <grothoff@gnunet.org>
Date: Fri, 22 Dec 2023 23:29:15 +0800
-minor code cleanup
Diffstat:
2 files changed, 18 insertions(+), 15 deletions(-)
diff --git a/src/json/json_helper.c b/src/json/json_helper.c
@@ -267,6 +267,9 @@ TALER_JSON_spec_currency_specification (
.size_ptr = NULL
};
+ memset (r_cspec,
+ 0,
+ sizeof (*r_cspec));
return ret;
}
@@ -345,11 +348,9 @@ TALER_JSON_spec_denomination_group (const char *name,
struct GNUNET_JSON_Specification ret = {
.cls = (void *) currency,
.parser = &parse_denomination_group,
- .cleaner = NULL,
.field = name,
.ptr = group,
- .ptr_size = sizeof(*group),
- .size_ptr = NULL,
+ .ptr_size = sizeof(*group)
};
return ret;
@@ -421,11 +422,8 @@ TALER_JSON_spec_econtract (const char *name,
struct GNUNET_JSON_Specification ret = {
.parser = &parse_econtract,
.cleaner = &clean_econtract,
- .cls = NULL,
.field = name,
- .ptr = econtract,
- .ptr_size = 0,
- .size_ptr = NULL
+ .ptr = econtract
};
return ret;
@@ -526,11 +524,8 @@ TALER_JSON_spec_age_commitment (const char *name,
struct GNUNET_JSON_Specification ret = {
.parser = &parse_age_commitment,
.cleaner = &clean_age_commitment,
- .cls = NULL,
.field = name,
- .ptr = age_commitment,
- .ptr_size = 0,
- .size_ptr = NULL
+ .ptr = age_commitment
};
return ret;
diff --git a/src/lib/exchange_api_handle.c b/src/lib/exchange_api_handle.c
@@ -928,10 +928,18 @@ decode_keys_json (const json_t *resp_obj,
GNUNET_JSON_spec_end ()
};
- EXITIF (GNUNET_OK !=
- GNUNET_JSON_parse (resp_obj,
- sspec,
- NULL, NULL));
+ if (GNUNET_OK !=
+ GNUNET_JSON_parse (resp_obj,
+ sspec,
+ &emsg,
+ &eline))
+ {
+ GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
+ "Parsing /keys failed for `%s' (%u)\n",
+ emsg,
+ eline);
+ EXITIF (1);
+ }
}
key_data->currency = GNUNET_strdup (currency);