aboutsummaryrefslogtreecommitdiff
path: root/src/testcurl/test_digestauth.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/testcurl/test_digestauth.c')
-rw-r--r--src/testcurl/test_digestauth.c19
1 files changed, 12 insertions, 7 deletions
diff --git a/src/testcurl/test_digestauth.c b/src/testcurl/test_digestauth.c
index 89076608..912efa11 100644
--- a/src/testcurl/test_digestauth.c
+++ b/src/testcurl/test_digestauth.c
@@ -162,9 +162,10 @@ testDigestAuth ()
162 fd = open("/dev/urandom", O_RDONLY); 162 fd = open("/dev/urandom", O_RDONLY);
163 if (-1 == fd) 163 if (-1 == fd)
164 { 164 {
165 fprintf(stderr, "Failed to open `%s': %s\n", 165 fprintf (stderr,
166 "/dev/urandom", 166 "Failed to open `%s': %s\n",
167 strerror(errno)); 167 "/dev/urandom",
168 strerror(errno));
168 return 1; 169 return 1;
169 } 170 }
170 while (off < 8) 171 while (off < 8)
@@ -172,9 +173,10 @@ testDigestAuth ()
172 len = read(fd, rnd, 8); 173 len = read(fd, rnd, 8);
173 if (len == (size_t)-1) 174 if (len == (size_t)-1)
174 { 175 {
175 fprintf(stderr, "Failed to read `%s': %s\n", 176 fprintf (stderr,
176 "/dev/urandom", 177 "Failed to read `%s': %s\n",
177 strerror(errno)); 178 "/dev/urandom",
179 strerror(errno));
178 (void) close(fd); 180 (void) close(fd);
179 return 1; 181 return 1;
180 } 182 }
@@ -218,7 +220,10 @@ testDigestAuth ()
218 { MHD_stop_daemon (d); return 32; } 220 { MHD_stop_daemon (d); return 32; }
219 port = (int)dinfo->port; 221 port = (int)dinfo->port;
220 } 222 }
221 sprintf(url, "http://127.0.0.1:%d/bar%20foo%3Fkey%3Dvalue", port); 223 snprintf (url,
224 sizeof (url),
225 "http://127.0.0.1:%d/bar%%20foo%%3Fkey%%3Dvalue",
226 port);
222 c = curl_easy_init (); 227 c = curl_easy_init ();
223 curl_easy_setopt (c, CURLOPT_URL, url); 228 curl_easy_setopt (c, CURLOPT_URL, url);
224 curl_easy_setopt (c, CURLOPT_WRITEFUNCTION, &copyBuffer); 229 curl_easy_setopt (c, CURLOPT_WRITEFUNCTION, &copyBuffer);