diff options
Diffstat (limited to 'src/backend/taler-merchant-httpd_private-get-transfers.c')
-rw-r--r-- | src/backend/taler-merchant-httpd_private-get-transfers.c | 63 |
1 files changed, 10 insertions, 53 deletions
diff --git a/src/backend/taler-merchant-httpd_private-get-transfers.c b/src/backend/taler-merchant-httpd_private-get-transfers.c index c43781dd..3e540297 100644 --- a/src/backend/taler-merchant-httpd_private-get-transfers.c +++ b/src/backend/taler-merchant-httpd_private-get-transfers.c @@ -137,59 +137,16 @@ TMH_private_get_transfers (const struct TMH_RequestHandler *rh, TALER_EC_GENERIC_PARAMETER_MALFORMED, "after"); } - { - const char *limit_s; - - limit_s = MHD_lookup_connection_value (connection, - MHD_GET_ARGUMENT_KIND, - "limit"); - if (NULL != limit_s) - { - char dummy[2]; - long long l; - - if (1 != - sscanf (limit_s, - "%lld%1s", - &l, - dummy)) - return TALER_MHD_reply_with_error (connection, - MHD_HTTP_BAD_REQUEST, - TALER_EC_GENERIC_PARAMETER_MALFORMED, - "limit"); - limit = (int64_t) l; - } - } - { - const char *offset_s; - - offset_s = MHD_lookup_connection_value (connection, - MHD_GET_ARGUMENT_KIND, - "offset"); - if (NULL != offset_s) - { - char dummy[2]; - unsigned long long o; - - if (1 != - sscanf (offset_s, - "%llu%1s", - &o, - dummy)) - return TALER_MHD_reply_with_error (connection, - MHD_HTTP_BAD_REQUEST, - TALER_EC_GENERIC_PARAMETER_MALFORMED, - "offset"); - offset = (uint64_t) o; - } - else - { - if (limit < 0) - offset = INT64_MAX; - else - offset = 0; - } - } + TALER_MHD_parse_request_snumber (connection, + "limit", + &limit); + if (limit < 0) + offset = INT64_MAX; + else + offset = 0; + TALER_MHD_parse_request_number (connection, + "offset", + &offset); if (! (TALER_arg_to_yna (connection, "verified", TALER_EXCHANGE_YNA_ALL, |