gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[taler-exchange] 13/13: -minor code cleanup


From: gnunet
Subject: [taler-exchange] 13/13: -minor code cleanup
Date: Fri, 22 Dec 2023 16:29:35 +0100

This is an automated email from the git hooks/post-receive script.

grothoff pushed a commit to branch master
in repository exchange.

commit ad09066a8ef65c054b8bd2718b74c038ab139886
Author: Christian Grothoff <grothoff@gnunet.org>
AuthorDate: Fri Dec 22 23:29:15 2023 +0800

    -minor code cleanup
---
 src/json/json_helper.c        | 17 ++++++-----------
 src/lib/exchange_api_handle.c | 16 ++++++++++++----
 2 files changed, 18 insertions(+), 15 deletions(-)

diff --git a/src/json/json_helper.c b/src/json/json_helper.c
index b339ff68..9f57c56f 100644
--- 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
index ed491c8b..27ce8506 100644
--- 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);

-- 
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]