summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2018-01-19 00:14:07 +0100
committerChristian Grothoff <christian@grothoff.org>2018-01-19 00:14:07 +0100
commitf7baa358b5792bb0443c468171889c485dbf9371 (patch)
tree5275f540d17a7f8db7f3e9c1284d506775fed9b2
parent569ef0096bfbbdb5f35ec709a83eb9b8d1043b82 (diff)
downloadmerchant-f7baa358b5792bb0443c468171889c485dbf9371.tar.gz
merchant-f7baa358b5792bb0443c468171889c485dbf9371.tar.bz2
merchant-f7baa358b5792bb0443c468171889c485dbf9371.zip
minor style fix
-rw-r--r--src/backend/taler-merchant-httpd.c42
1 files changed, 25 insertions, 17 deletions
diff --git a/src/backend/taler-merchant-httpd.c b/src/backend/taler-merchant-httpd.c
index 572f5cf2..f4a11363 100644
--- 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,