← Commit list

fa8bd1cc09

Viktor Szakats
Viktor Szakats
2026-02-27
SUCCESS Duration: 361s

Subject

mprintf: use `_snprintf()` when compiled with VS2013 and older

Binary

No binary (build failed)

Architecture & Compiler Flags

Architecture: x86_64-linux-gnu Compiler: gcc (Ubuntu 11.4.0-1ubuntu1~22.04.3) 11.4.0

—

Build Log

(log yok)

Commit Diff GitHub →

lib/curl_setup.h+1 -1
@@ -90,7 +90,7 @@
/* Disable Visual Studio warnings: 4127 "conditional expression is constant" */
#pragma warning(disable:4127)
#ifndef _CRT_SECURE_NO_WARNINGS
-#define _CRT_SECURE_NO_WARNINGS /* for getenv(), tests: sscanf() */
+#define _CRT_SECURE_NO_WARNINGS /* for _snprintf(), getenv(), sscanf() */
#endif
#endif /* _MSC_VER */
lib/mprintf.c+3 -0
@@ -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;