aboutsummaryrefslogtreecommitdiff
path: root/src/util
diff options
context:
space:
mode:
Diffstat (limited to 'src/util')
-rw-r--r--src/util/conversion.c23
-rw-r--r--src/util/test_amount.c4
-rw-r--r--src/util/url.c2
3 files changed, 16 insertions, 13 deletions
diff --git a/src/util/conversion.c b/src/util/conversion.c
index 501ca0145..fdeffba40 100644
--- a/src/util/conversion.c
+++ b/src/util/conversion.c
@@ -251,7 +251,7 @@ child_done_cb (void *cls,
long unsigned int exit_code)
{
struct TALER_JSON_ExternalConversion *ec = cls;
- json_t *j;
+ json_t *j = NULL;
json_error_t err;
ec->cwh = NULL;
@@ -269,16 +269,19 @@ child_done_cb (void *cls,
}
GNUNET_OS_process_destroy (ec->helper);
ec->helper = NULL;
- j = json_loadb (ec->read_buf,
- ec->read_pos,
- JSON_REJECT_DUPLICATES,
- &err);
- if (NULL == j)
+ if (0 != ec->read_pos)
{
- GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
- "Failed to parse JSON from helper at %d: %s\n",
- err.position,
- err.text);
+ j = json_loadb (ec->read_buf,
+ ec->read_pos,
+ JSON_REJECT_DUPLICATES,
+ &err);
+ if (NULL == j)
+ {
+ GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
+ "Failed to parse JSON from helper at %d: %s\n",
+ err.position,
+ err.text);
+ }
}
ec->cb (ec->cb_cls,
type,
diff --git a/src/util/test_amount.c b/src/util/test_amount.c
index c94f24fe5..a45b71de7 100644
--- a/src/util/test_amount.c
+++ b/src/util/test_amount.c
@@ -85,8 +85,8 @@ main (int argc,
GNUNET_assert (0 == a2.value);
GNUNET_assert (TALER_AMOUNT_FRAC_BASE / 100 * 2 == a2.fraction);
c = TALER_amount_to_string (&a2);
- GNUNET_assert (0 == strcmp ("eur:0.02",
- c));
+ GNUNET_assert (0 == strcasecmp ("eur:0.02",
+ c));
GNUNET_free (c);
/* test conversion with leading space and with fraction */
diff --git a/src/util/url.c b/src/util/url.c
index a140a3a2e..1ac197551 100644
--- a/src/util/url.c
+++ b/src/util/url.c
@@ -322,7 +322,7 @@ TALER_url_valid_charset (const char *url)
for (unsigned int i = 0; '\0' != url[i]; i++)
{
#define ALLOWED_CHARACTERS \
- "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789/:;&?-.,=_~%+"
+ "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789/:;&?-.,=_~%+#"
if (NULL == strchr (ALLOWED_CHARACTERS,
(int) url[i]))
return false;