do not cut out &start= post-hum, just build the string right the first time

This commit is contained in:
Christian Grothoff 2019-06-03 00:26:53 +02:00
parent f725593155
commit 7d142ad261
No known key found for this signature in database
GPG Key ID: 939E6BE1E29FC3CC

View File

@ -482,21 +482,23 @@ TALER_BANK_history (struct GNUNET_CURL_Context *ctx,
return NULL; return NULL;
} }
GNUNET_asprintf (&url, if (UINT64_MAX == start_row)
"/history?auth=basic&account_number=%llu&delta=%lld&direction=%s&cancelled=%s&ordering=%s&start=%llu", GNUNET_asprintf (&url,
"/history?auth=basic&account_number=%llu&delta=%lld&direction=%s&cancelled=%s&ordering=%s",
(unsigned long long) account_number, (unsigned long long) account_number,
(long long) num_results, (long long) num_results,
conv_direction (direction).value, conv_direction (direction).value,
conv_cancel (direction).value, conv_cancel (direction).value,
(GNUNET_YES == ascending) ? "ascending" : "descending", (GNUNET_YES == ascending) ? "ascending" : "descending");
start_row); else
GNUNET_asprintf (&url,
/* Locate and "cut" the 'start' argument, "/history?auth=basic&account_number=%llu&delta=%lld&direction=%s&cancelled=%s&ordering=%s&start=%llu",
* if the user didn't provide one. */ (unsigned long long) account_number,
if (UINT64_MAX == start_row) (long long) num_results,
*strstr (url, conv_direction (direction).value,
"&start=") = '\0'; conv_cancel (direction).value,
(GNUNET_YES == ascending) ? "ascending" : "descending",
start_row);
hh = put_history_job (ctx, hh = put_history_job (ctx,
bank_base_url, bank_base_url,
url, url,