aboutsummaryrefslogtreecommitdiff
path: root/tests/server/tftpd.c
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2018-11-22 09:01:24 +0100
committerDaniel Stenberg <daniel@haxx.se>2018-11-23 08:26:51 +0100
commitdcd6f810255785d52b89150e18460fb0899d4f7e (patch)
treec3cb7cdcb79dbf752edcd997934e44a2e9998397 /tests/server/tftpd.c
parent9944d6ba334f07b0b6199bdb5bb82091c88c16ed (diff)
snprintf: renamed and we now only use msnprintf()
The function does not return the same value as snprintf() normally does, so readers may be mislead into thinking the code works differently than it actually does. A different function name makes this easier to detect. Reported-by: Tomas Hoger Assisted-by: Daniel Gustafsson Fixes #3296 Closes #3297
Diffstat (limited to 'tests/server/tftpd.c')
-rw-r--r--tests/server/tftpd.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/tests/server/tftpd.c b/tests/server/tftpd.c
index c00731fa2..35419b0b9 100644
--- a/tests/server/tftpd.c
+++ b/tests/server/tftpd.c
@@ -15,7 +15,7 @@
*/
/*
- * Copyright (c) 1983, 2016 Regents of the University of California.
+ * Copyright (c) 1983 Regents of the University of California.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -569,7 +569,7 @@ static ssize_t write_behind(struct testcase *test, int convert)
if(!test->ofile) {
char outfile[256];
- snprintf(outfile, sizeof(outfile), "log/upload.%ld", test->testno);
+ msnprintf(outfile, sizeof(outfile), "log/upload.%ld", test->testno);
#ifdef WIN32
test->ofile = open(outfile, O_CREAT|O_RDWR|O_BINARY, 0777);
#else
@@ -1141,8 +1141,8 @@ static int validate_access(struct testcase *test,
if(!strncmp("verifiedserver", filename, 14)) {
char weare[128];
- size_t count = snprintf(weare, sizeof(weare),
- "WE ROOLZ: %ld\r\n", (long)getpid());
+ size_t count = msnprintf(weare, sizeof(weare),
+ "WE ROOLZ: %ld\r\n", (long)getpid());
logmsg("Are-we-friendly question received");
test->buffer = strdup(weare);
@@ -1187,7 +1187,7 @@ static int validate_access(struct testcase *test,
file = test2file(testno);
if(0 != partno)
- snprintf(partbuf, sizeof(partbuf), "data%ld", partno);
+ msnprintf(partbuf, sizeof(partbuf), "data%ld", partno);
if(file) {
FILE *stream = fopen(file, "rb");