diff options
author | Brad King <brad.king@kitware.com> | 2023-10-12 19:29:04 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2023-10-12 19:29:20 (GMT) |
commit | df4efb72e4225dc3fd4f32313bc8b19122a98f66 (patch) | |
tree | dbbb93a136f4f44184cbab061b03489379ef717c /Utilities/cmcurl/lib/formdata.c | |
parent | 8f6a6b02e59c112dbe971adca4f25938903828ea (diff) | |
parent | e6a6c1abc1e6b6e3ca9fa77947279509b55e2b01 (diff) | |
download | CMake-df4efb72e4225dc3fd4f32313bc8b19122a98f66.zip CMake-df4efb72e4225dc3fd4f32313bc8b19122a98f66.tar.gz CMake-df4efb72e4225dc3fd4f32313bc8b19122a98f66.tar.bz2 |
Merge branch 'upstream-curl' into update-curl
* upstream-curl:
curl 2023-10-11 (d755a5f7)
Issue: #25329
Diffstat (limited to 'Utilities/cmcurl/lib/formdata.c')
-rw-r--r-- | Utilities/cmcurl/lib/formdata.c | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/Utilities/cmcurl/lib/formdata.c b/Utilities/cmcurl/lib/formdata.c index 8984b63..e40c4bc 100644 --- a/Utilities/cmcurl/lib/formdata.c +++ b/Utilities/cmcurl/lib/formdata.c @@ -789,6 +789,20 @@ static CURLcode setname(curl_mimepart *part, const char *name, size_t len) return res; } +/* wrap call to fseeko so it matches the calling convention of callback */ +static int fseeko_wrapper(void *stream, curl_off_t offset, int whence) +{ +#if defined(HAVE_FSEEKO) + return fseeko(stream, (off_t)offset, whence); +#elif defined(HAVE__FSEEKI64) + return _fseeki64(stream, (__int64)offset, whence); +#else + if(offset > LONG_MAX) + return -1; + return fseek(stream, (long)offset, whence); +#endif +} + /* * Curl_getformdata() converts a linked list of "meta data" into a mime * structure. The input list is in 'post', while the output is stored in @@ -874,8 +888,7 @@ CURLcode Curl_getformdata(struct Curl_easy *data, compatibility: use of "-" pseudo file name should be avoided. */ result = curl_mime_data_cb(part, (curl_off_t) -1, (curl_read_callback) fread, - CURLX_FUNCTION_CAST(curl_seek_callback, - fseek), + fseeko_wrapper, NULL, (void *) stdin); } else |