mirror of
https://github.com/curl/curl.git
synced 2026-04-14 21:31:42 +03:00
mprintf: use _snprintf() when compiled with VS2013 and older
To support floats and doubles when using these old compilers.
Before this patch, these tests most likely failed with them:
```
FAIL 557: 'curl_mprintf() testing' printf, unittest
FAIL 566: 'HTTP GET with CURLINFO_CONTENT_LENGTH_DOWNLOAD and 0 bytes transfer' HTTP, HTTP GET
FAIL 599: 'HTTP GET with progress callback and redirects changing content sizes' HTTP, HTTP POST, chunked Transfer-Encoding
FAIL 1148: 'progress-bar' HTTP, progressbar
```
Also:
- mention `_snprintf()` in the `_CRT_SECURE_NO_WARNINGS` comment.
Follow-up to 7de35515d9 #20218
Closes #20761
This commit is contained in:
parent
00b215b894
commit
fa8bd1cc09
2 changed files with 4 additions and 1 deletions
|
|
@ -688,6 +688,9 @@ static bool out_double(void *userp,
|
|||
buffer if it reaches the max size so we do that here. */
|
||||
work[BUFFSIZE - 1] = 0;
|
||||
#endif
|
||||
#elif defined(_MSC_VER) && (_MSC_VER < 1900)
|
||||
_snprintf(work, BUFFSIZE, formatbuf, dnum);
|
||||
work[BUFFSIZE - 1] = 0;
|
||||
#else
|
||||
/* float and double outputs do not work without snprintf support */
|
||||
work[0] = 0;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue