diff options
author | Christian Grothoff <christian@grothoff.org> | 2015-05-17 16:53:00 +0200 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2015-05-17 16:53:00 +0200 |
commit | 3817f83dd5b65fb7d475560b2637276a89f69087 (patch) | |
tree | bf9b12189c616ca421cc6036b355b17e472601c5 /src/util/json.c | |
parent | 25e530f37a09dd154d09e468cc724252524da6c6 (diff) | |
download | exchange-3817f83dd5b65fb7d475560b2637276a89f69087.tar.gz exchange-3817f83dd5b65fb7d475560b2637276a89f69087.tar.bz2 exchange-3817f83dd5b65fb7d475560b2637276a89f69087.zip |
adding testcase for json-amount conversions, fixing typos and missing currency initialization
Diffstat (limited to 'src/util/json.c')
-rw-r--r-- | src/util/json.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/util/json.c b/src/util/json.c index 1747cd927..90031faae 100644 --- a/src/util/json.c +++ b/src/util/json.c @@ -227,10 +227,13 @@ TALER_json_to_amount (json_t *json, &error, JSON_STRICT, "{s:s, s:I, s:I}", - "curreny", ¤cy, + "currency", ¤cy, "value", &value, "fraction", &fraction)); EXITIF (3 < strlen (currency)); + EXITIF (TALER_CURRENCY_LEN <= strlen (currency)); + strcpy (r_amount->currency, + currency); r_amount->value = (uint32_t) value; r_amount->fraction = (uint32_t) fraction; return GNUNET_OK; |