summaryrefslogtreecommitdiff
path: root/src/bank-lib
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2019-06-03 00:26:53 +0200
committerChristian Grothoff <christian@grothoff.org>2019-06-03 00:26:53 +0200
commit7d142ad261ca92930d055b836747264212fcfffe (patch)
tree3a7855218d6ac432e27c3ef9c0964c02beb6ae96 /src/bank-lib
parentf7255931558bf788073af15b7e433680a10f218c (diff)
downloadexchange-7d142ad261ca92930d055b836747264212fcfffe.tar.gz
exchange-7d142ad261ca92930d055b836747264212fcfffe.tar.bz2
exchange-7d142ad261ca92930d055b836747264212fcfffe.zip
do not cut out &start= post-hum, just build the string right the first time
Diffstat (limited to 'src/bank-lib')
-rw-r--r--src/bank-lib/bank_api_history.c24
1 files changed, 13 insertions, 11 deletions
diff --git a/src/bank-lib/bank_api_history.c b/src/bank-lib/bank_api_history.c
index 53c381f67..2520fa16f 100644
--- a/src/bank-lib/bank_api_history.c
+++ b/src/bank-lib/bank_api_history.c
@@ -482,21 +482,23 @@ TALER_BANK_history (struct GNUNET_CURL_Context *ctx,
return NULL;
}
- GNUNET_asprintf (&url,
- "/history?auth=basic&account_number=%llu&delta=%lld&direction=%s&cancelled=%s&ordering=%s&start=%llu",
+ if (UINT64_MAX == start_row)
+ GNUNET_asprintf (&url,
+ "/history?auth=basic&account_number=%llu&delta=%lld&direction=%s&cancelled=%s&ordering=%s",
(unsigned long long) account_number,
(long long) num_results,
conv_direction (direction).value,
conv_cancel (direction).value,
- (GNUNET_YES == ascending) ? "ascending" : "descending",
- start_row);
-
- /* Locate and "cut" the 'start' argument,
- * if the user didn't provide one. */
- if (UINT64_MAX == start_row)
- *strstr (url,
- "&start=") = '\0';
-
+ (GNUNET_YES == ascending) ? "ascending" : "descending");
+ else
+ GNUNET_asprintf (&url,
+ "/history?auth=basic&account_number=%llu&delta=%lld&direction=%s&cancelled=%s&ordering=%s&start=%llu",
+ (unsigned long long) account_number,
+ (long long) num_results,
+ conv_direction (direction).value,
+ conv_cancel (direction).value,
+ (GNUNET_YES == ascending) ? "ascending" : "descending",
+ start_row);
hh = put_history_job (ctx,
bank_base_url,
url,