aboutsummaryrefslogtreecommitdiff
path: root/tests/libtest/lib1510.c
diff options
context:
space:
mode:
Diffstat (limited to 'tests/libtest/lib1510.c')
-rw-r--r--tests/libtest/lib1510.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/tests/libtest/lib1510.c b/tests/libtest/lib1510.c
index 3d791e01e..d28bef39a 100644
--- a/tests/libtest/lib1510.c
+++ b/tests/libtest/lib1510.c
@@ -44,7 +44,7 @@ int test(char *URL)
/* Create fake DNS entries for serverX.example.com for all handles */
for(i=0; i < NUM_URLS; i++) {
- sprintf(dnsentry, "server%d.example.com:%s:%s", i + 1, port, address);
+ snprintf(dnsentry, sizeof(dnsentry), "server%d.example.com:%s:%s", i + 1, port, address);
printf("%s\n", dnsentry);
slist2 = curl_slist_append(slist, dnsentry);
if(!slist2) {
@@ -73,8 +73,9 @@ int test(char *URL)
/* get NUM_HANDLES easy handles */
for(i=0; i < NUM_URLS; i++) {
/* specify target */
- sprintf(target_url, "http://server%d.example.com:%s/path/1510%04i",
- i + 1, port, i + 1);
+ snprintf(target_url, sizeof(target_url),
+ "http://server%d.example.com:%s/path/1510%04i",
+ i + 1, port, i + 1);
target_url[sizeof(target_url) - 1] = '\0';
easy_setopt(curl, CURLOPT_URL, target_url);