/* 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) {
/* 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);