From fdb7270397945c47db0b4347a969876c545031f5 Mon Sep 17 00:00:00 2001 From: liuxianliang Date: Sat, 19 Jun 2021 16:21:01 +0800 Subject: [PATCH] [fix] set default parameter of "size". --- samples/webclient_shard_download_sample.c | 3 ++- src/webclient.c | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/samples/webclient_shard_download_sample.c b/samples/webclient_shard_download_sample.c index 5a6d2e2..d60c283 100644 --- a/samples/webclient_shard_download_sample.c +++ b/samples/webclient_shard_download_sample.c @@ -57,8 +57,9 @@ int webclient_shard_download_test(int argc, char **argv) struct webclient_session* session = RT_NULL; rt_err_t result = RT_EOK; char *uri = RT_NULL; - int length, size = 0; + int length = 0; int usage_flag = 0; + int size = 200; if (argc == 1) diff --git a/src/webclient.c b/src/webclient.c index dac2bca..df4716e 100644 --- a/src/webclient.c +++ b/src/webclient.c @@ -1050,6 +1050,7 @@ int webclient_shard_position_function(struct webclient_session *session, const c RT_ASSERT(session); RT_ASSERT(URI); + RT_ASSERT(mem_size); /* set the offset of "Range" and "total_len" */ end_position = start;