diff options
author | Brad King <brad.king@kitware.com> | 2017-05-11 14:55:44 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2017-05-11 15:27:21 (GMT) |
commit | 299975908ada992800791fac7f3739050e0ae2a9 (patch) | |
tree | 38cd8fb04ce84196dfa04d514eb92649900a1bc5 /Utilities/cmcurl/lib/file.c | |
parent | 5af9c8e2451afd8e63d6b05e69cd141af543a164 (diff) | |
parent | fd7d521c9d70655618db8232d45e5aaf81700f91 (diff) | |
download | CMake-299975908ada992800791fac7f3739050e0ae2a9.zip CMake-299975908ada992800791fac7f3739050e0ae2a9.tar.gz CMake-299975908ada992800791fac7f3739050e0ae2a9.tar.bz2 |
Merge branch 'upstream-curl' into update-curl
* upstream-curl:
curl 2017-04-19 (d957e218)
Resolve conflicts in `CMakeLists.txt` in favor of the upstream version.
We will re-apply our logic as needed in following commits.
Diffstat (limited to 'Utilities/cmcurl/lib/file.c')
-rw-r--r-- | Utilities/cmcurl/lib/file.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/Utilities/cmcurl/lib/file.c b/Utilities/cmcurl/lib/file.c index 3dbc0f2..b26bdea 100644 --- a/Utilities/cmcurl/lib/file.c +++ b/Utilities/cmcurl/lib/file.c @@ -355,8 +355,7 @@ static CURLcode file_upload(struct connectdata *conn) failf(data, "Can't get the size of %s", file->path); return CURLE_WRITE_ERROR; } - else - data->state.resume_from = (curl_off_t)file_stat.st_size; + data->state.resume_from = (curl_off_t)file_stat.st_size; } while(!result) { @@ -476,7 +475,7 @@ static CURLcode file_do(struct connectdata *conn, bool *done) time_t filetime; struct tm buffer; const struct tm *tm = &buffer; - snprintf(buf, sizeof(data->state.buffer), + snprintf(buf, CURL_BUFSIZE(data->set.buffer_size), "Content-Length: %" CURL_FORMAT_CURL_OFF_T "\r\n", expected_size); result = Curl_client_write(conn, CLIENTWRITE_BOTH, buf, 0); if(result) @@ -519,8 +518,7 @@ static CURLcode file_do(struct connectdata *conn, bool *done) failf(data, "Can't get the size of file."); return CURLE_READ_ERROR; } - else - data->state.resume_from += (curl_off_t)statbuf.st_size; + data->state.resume_from += (curl_off_t)statbuf.st_size; } if(data->state.resume_from <= expected_size) |