[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] [libmicrohttpd] branch master updated: fix format string, p
From: |
gnunet |
Subject: |
[GNUnet-SVN] [libmicrohttpd] branch master updated: fix format string, prefer snprintf |
Date: |
Sun, 18 Nov 2018 12:03:19 +0100 |
This is an automated email from the git hooks/post-receive script.
grothoff pushed a commit to branch master
in repository libmicrohttpd.
The following commit(s) were added to refs/heads/master by this push:
new 49936d88 fix format string, prefer snprintf
49936d88 is described below
commit 49936d88d98b50a24d0ab9dee8ef31778ec9c167
Author: Christian Grothoff <address@hidden>
AuthorDate: Sun Nov 18 12:03:16 2018 +0100
fix format string, prefer snprintf
---
src/testcurl/test_digestauth.c | 19 ++++++++++++-------
1 file 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 ()
fd = open("/dev/urandom", O_RDONLY);
if (-1 == fd)
{
- fprintf(stderr, "Failed to open `%s': %s\n",
- "/dev/urandom",
- strerror(errno));
+ fprintf (stderr,
+ "Failed to open `%s': %s\n",
+ "/dev/urandom",
+ strerror(errno));
return 1;
}
while (off < 8)
@@ -172,9 +173,10 @@ testDigestAuth ()
len = read(fd, rnd, 8);
if (len == (size_t)-1)
{
- fprintf(stderr, "Failed to read `%s': %s\n",
- "/dev/urandom",
- strerror(errno));
+ fprintf (stderr,
+ "Failed to read `%s': %s\n",
+ "/dev/urandom",
+ strerror(errno));
(void) close(fd);
return 1;
}
@@ -218,7 +220,10 @@ testDigestAuth ()
{ MHD_stop_daemon (d); return 32; }
port = (int)dinfo->port;
}
- sprintf(url, "http://127.0.0.1:%d/bar%20foo%3Fkey%3Dvalue", port);
+ snprintf (url,
+ sizeof (url),
+ "http://127.0.0.1:%d/bar%%20foo%%3Fkey%%3Dvalue",
+ port);
c = curl_easy_init ();
curl_easy_setopt (c, CURLOPT_URL, url);
curl_easy_setopt (c, CURLOPT_WRITEFUNCTION, ©Buffer);
--
To stop receiving notification emails like this one, please contact
address@hidden