summaryrefslogtreecommitdiff
path: root/lib/config-win32.h
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2022-09-22 11:52:08 +0200
committerDaniel Stenberg <daniel@haxx.se>2022-09-22 23:06:26 +0200
commit935b1bd4544a23a91d68ffb9f86983e92747e9a5 (patch)
treeb31b3868b60c475dd60bc6d9195ecdf57d9c0614 /lib/config-win32.h
parentbf1571eb6ff24a8299da7da84408da31f0094f66 (diff)
downloadcurl-935b1bd4544a23a91d68ffb9f86983e92747e9a5.tar.gz
mprintf: use snprintf if available
This is the single place in libcurl code where it uses the "native" s(n)printf() function. Used for writing floats. The use has been reviewed and vetted and uses a HUGE target buffer, but switching to snprintf() still makes this safer and removes build-time warnings. Reported-by: Philip Heiduck Fixes #9569 Closes #9570
Diffstat (limited to 'lib/config-win32.h')
-rw-r--r--lib/config-win32.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/config-win32.h b/lib/config-win32.h
index 0ac529d25..7c9cdf1fc 100644
--- a/lib/config-win32.h
+++ b/lib/config-win32.h
@@ -254,6 +254,11 @@
/* Define to the function return type for send. */
#define SEND_TYPE_RETV int
+/* Define to 1 if you have the snprintf function. */
+#if defined(_MSC_VER) && (_MSC_VER >= 1900)
+#define HAVE_SNPRINTF 1
+#endif
+
/* ---------------------------------------------------------------- */
/* TYPEDEF REPLACEMENTS */
/* ---------------------------------------------------------------- */