aboutsummaryrefslogtreecommitdiff
path: root/tests/libtest/lib553.c
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2016-04-01 10:14:06 +0200
committerDaniel Stenberg <daniel@haxx.se>2016-04-01 10:46:36 +0200
commit55452ebdff47f98bf3cc383f1dfc3623fcaefefd (patch)
treed17d3be8fd9482658f07ef6b4532da9502499cf0 /tests/libtest/lib553.c
parent7218b52c49aeb1452d1fb94b394b3de2da938f17 (diff)
curl/mprintf.h: remove support for _MPRINTF_REPLACE
The define is not in our name space and is therefore not protected by our API promises. It was only really used by libcurl internals but was mostly erased from there already in 8aabbf5 (March 2015). This is supposedly the final death blow to that define from everywhere. As a side-effect, making sure _MPRINTF_REPLACE is gone and not used, I made the lib tests in tests/libtest/ use curl_printf.h for its redefine magic and then subsequently the use of sprintf() got banned in the tests as well (as it is in libcurl internals) and I then replaced them all with snprintf(). In the unlikely event that any users is actually using this define and gets sad by this change, it is very easily copied to the user's own code.
Diffstat (limited to 'tests/libtest/lib553.c')
-rw-r--r--tests/libtest/lib553.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/tests/libtest/lib553.c b/tests/libtest/lib553.c
index 96d569901..ab4db74c7 100644
--- a/tests/libtest/lib553.c
+++ b/tests/libtest/lib553.c
@@ -5,7 +5,7 @@
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
- * Copyright (C) 1998 - 2011, Daniel Stenberg, <daniel@haxx.se>, et al.
+ * Copyright (C) 1998 - 2016, Daniel Stenberg, <daniel@haxx.se>, et al.
*
* This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms
@@ -74,7 +74,7 @@ int test(char *URL)
}
for (i = 0; i < NUM_HEADERS; i++) {
- int len = sprintf(buf, "Header%d: ", i);
+ int len = snprintf(buf, sizeof(buf), "Header%d: ", i);
memset(&buf[len], 'A', SIZE_HEADERS);
buf[len + SIZE_HEADERS]=0; /* zero terminate */
hl = curl_slist_append(headerlist, buf);