merchant

Merchant backend to process payments, run by merchants
Log | Files | Refs | Submodules | README | LICENSE

commit f7baa358b5792bb0443c468171889c485dbf9371
parent 569ef0096bfbbdb5f35ec709a83eb9b8d1043b82
Author: Christian Grothoff <christian@grothoff.org>
Date:   Fri, 19 Jan 2018 00:14:07 +0100

minor style fix

Diffstat:
Msrc/backend/taler-merchant-httpd.c | 42+++++++++++++++++++++++++-----------------
1 file changed, 25 insertions(+), 17 deletions(-)

diff --git a/src/backend/taler-merchant-httpd.c b/src/backend/taler-merchant-httpd.c @@ -523,6 +523,17 @@ static void locations_iterator_cb (void *cls, const char *section) { + static const char *keys[] = { + "country", + "city", + "state", + "region", + "province", + "zip_code", + "street", + "street_number", + NULL, + }; struct GNUNET_CONFIGURATION_Handle *cfg = cls; const char *prefix = "merchant-location-"; const char *substr = strstr (section, prefix); @@ -531,32 +542,28 @@ locations_iterator_cb (void *cls, if ( (NULL == substr) || (substr != section) ) return; - locname = section + strlen (prefix); if (0 == strlen (locname)) return; - GNUNET_assert (json_is_object (default_locations)); loc = json_object (); - json_object_set_new (default_locations, locname, loc); - - char *keys[] = { - "country", "city", "state", "region", "province", - "zip_code", "street", "street_number", - NULL, - }; - + json_object_set_new (default_locations, + locname, + loc); for (unsigned int pos = 0; NULL != keys[pos]; pos++) { char *val; - (void) GNUNET_CONFIGURATION_get_value_string (cfg, - section, - keys[pos], - &val); - if (NULL != val) + + if (GNUNET_OK == + GNUNET_CONFIGURATION_get_value_string (cfg, + section, + keys[pos], + &val)) { - json_object_set_new (loc, keys[pos], json_string (val)); + json_object_set_new (loc, + keys[pos], + json_string (val)); GNUNET_free (val); } } @@ -587,7 +594,8 @@ instances_iterator_cb (void *cls, char *emsg; iic = cls; - substr = strstr (section, "merchant-instance-"); + substr = strstr (section, + "merchant-instance-"); if ( (NULL == substr) || (NULL != strstr (section,