diff options
| author | Özgür Kesim <oec-taler@kesim.org> | 2023-06-03 10:45:31 +0200 | 
|---|---|---|
| committer | Özgür Kesim <oec-taler@kesim.org> | 2023-06-03 10:45:31 +0200 | 
| commit | 80a1b8f5240e8307e1c73862fb8810d7c2bdc874 (patch) | |
| tree | 5661068ec9976aa8711dc931355f6bd87ab35fd6 /src/util/conversion.c | |
| parent | 4a31a180a4595aa040060e91ccde4f839aa02f72 (diff) | |
| parent | 2ea3ae1008020589b43a51663c45556a08547212 (diff) | |
Merge branch 'master' into age-withdraw
Diffstat (limited to 'src/util/conversion.c')
| -rw-r--r-- | src/util/conversion.c | 23 | 
1 files changed, 13 insertions, 10 deletions
diff --git a/src/util/conversion.c b/src/util/conversion.c index 501ca014..fdeffba4 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,  | 
