aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorSteve Holme <steve_holme@hotmail.com>2016-04-03 00:02:19 +0100
committerSteve Holme <steve_holme@hotmail.com>2016-04-03 00:02:19 +0100
commit0326b06770d6a3bd8c877497ef949ff4cdf30210 (patch)
treef37a899cb30dc8881e4aed4b742c61182f64050e /tests
parente238253d06199e15f86d860a367b8b9250a7ff7f (diff)
unittests: Fixed compilation warnings
warning: implicit declaration of function 'sprintf_was_used' [-Wimplicit-function-declaration] Follow up to the modications made to tests/libtest in commit 55452ebdff as we prefer not to use sprintf() now.
Diffstat (limited to 'tests')
-rw-r--r--tests/unit/unit1604.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/tests/unit/unit1604.c b/tests/unit/unit1604.c
index c61f010dc..3fb9636ee 100644
--- a/tests/unit/unit1604.c
+++ b/tests/unit/unit1604.c
@@ -45,7 +45,7 @@ static void unit_stop(void)
static char *getflagstr(int flags) {
char *buf = malloc(256);
fail_unless(buf, "out of memory");
- sprintf(buf, "%s,%s,%s,%s",
+ snprintf(buf, sizeof(buf), "%s,%s,%s,%s",
((flags & SANITIZE_ALLOW_COLONS) ? "SANITIZE_ALLOW_COLONS" : ""),
((flags & SANITIZE_ALLOW_PATH) ? "SANITIZE_ALLOW_PATH" : ""),
((flags & SANITIZE_ALLOW_RESERVED) ? "SANITIZE_ALLOW_RESERVED" : ""),
@@ -56,7 +56,7 @@ static char *getflagstr(int flags) {
static char *getcurlcodestr(int cc) {
char *buf = malloc(256);
fail_unless(buf, "out of memory");
- sprintf(buf, "%s (%d)",
+ snprintf(buf, sizeof(buf), "%s (%d)",
(cc == SANITIZE_ERR_OK ? "SANITIZE_ERR_OK" :
cc == SANITIZE_ERR_BAD_ARGUMENT ? "SANITIZE_ERR_BAD_ARGUMENT" :
cc == SANITIZE_ERR_INVALID_PATH ? "SANITIZE_ERR_INVALID_PATH" :