diff options
author | Christian Grothoff <christian@grothoff.org> | 2015-05-17 17:57:31 +0200 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2015-05-17 17:57:31 +0200 |
commit | cdc0f43f359821b12faa74f9823ba091c2897ee3 (patch) | |
tree | 087d194495f63e32146343ac33c000b9b551f06c /src/util/wireformats.c | |
parent | 9896e8e96ac00a1599216ae30fed76a1ec18ce15 (diff) | |
download | exchange-cdc0f43f359821b12faa74f9823ba091c2897ee3.tar.gz exchange-cdc0f43f359821b12faa74f9823ba091c2897ee3.tar.bz2 exchange-cdc0f43f359821b12faa74f9823ba091c2897ee3.zip |
slightly expand wireformat test to cover error cases
Diffstat (limited to 'src/util/wireformats.c')
-rw-r--r-- | src/util/wireformats.c | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/src/util/wireformats.c b/src/util/wireformats.c index e86044d7e..7ea4fd067 100644 --- a/src/util/wireformats.c +++ b/src/util/wireformats.c @@ -297,10 +297,11 @@ validate_iban (const char *iban) dividend += remainder * (pow (10, nread)); remainder = dividend % 97; } - EXITIF (1 != remainder); - GNUNET_free (nbuf); - return GNUNET_YES; - + if (1 == remainder) + { + GNUNET_free (nbuf); + return GNUNET_YES; + } EXITIF_exit: GNUNET_free (nbuf); return GNUNET_NO; @@ -345,7 +346,13 @@ validate_sepa (const json_t *wire) "r", &r, "address", &address)); EXITIF (0 != strcmp (type, "SEPA")); - EXITIF (1 != validate_iban (iban)); + if (1 != validate_iban (iban)) + { + GNUNET_log (GNUNET_ERROR_TYPE_INFO, + "IBAN `%s' invalid\n", + iban); + return GNUNET_NO; + } return GNUNET_YES; EXITIF_exit: return GNUNET_NO; @@ -393,7 +400,7 @@ TALER_json_validate_wireformat (const char *type, if (0 == strcasecmp (format_handlers[i].type, type)) return format_handlers[i].handler (wire); - GNUNET_log (GNUNET_ERROR_TYPE_ERROR, + GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Wireformat `%s' not supported\n", type); return GNUNET_NO; |