aboutsummaryrefslogtreecommitdiff
path: root/tests/server/fake_ntlm.c
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2016-04-03 22:35:43 +0200
committerDaniel Stenberg <daniel@haxx.se>2016-04-03 22:38:36 +0200
commita332c4f769dc25bdc57ebb88bccef03d7ca6b258 (patch)
treebb555dd587a6cac23d369843983fdb7fd6848a73 /tests/server/fake_ntlm.c
parenta71012c03ef6a7cbfba69bcafb559fa417c49af0 (diff)
tests/server: comply with our code style
Diffstat (limited to 'tests/server/fake_ntlm.c')
-rw-r--r--tests/server/fake_ntlm.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/tests/server/fake_ntlm.c b/tests/server/fake_ntlm.c
index 5b4d4fe98..87118b315 100644
--- a/tests/server/fake_ntlm.c
+++ b/tests/server/fake_ntlm.c
@@ -76,7 +76,7 @@ static char *printable(char *inbuf, size_t inlength)
return NULL;
if(!inlength) {
- sprintf(&outbuf[0], "%s", NOTHING_STR);
+ snprintf(&outbuf[0], outsize, "%s", NOTHING_STR);
return outbuf;
}
@@ -98,7 +98,7 @@ static char *printable(char *inbuf, size_t inlength)
o++;
}
else {
- sprintf(&outbuf[o], HEX_FMT_STR, inbuf[i]);
+ snprintf(&outbuf[o], outsize - o, HEX_FMT_STR, inbuf[i]);
o += HEX_STR_LEN;
}
@@ -163,7 +163,7 @@ int main(int argc, char *argv[])
(use_cached_creds) ? "yes" : "no");
env = getenv("CURL_NTLM_AUTH_TESTNUM");
- if (env) {
+ if(env) {
char *endptr;
long lnum = strtol(env, &endptr, 10);
if((endptr != env + strlen(env)) || (lnum < 1L)) {
@@ -171,13 +171,14 @@ int main(int argc, char *argv[])
exit(1);
}
testnum = lnum;
- } else {
+ }
+ else {
logmsg("Test number not specified in CURL_NTLM_AUTH_TESTNUM");
exit(1);
}
env = getenv("CURL_NTLM_AUTH_SRCDIR");
- if (env) {
+ if(env) {
path = env;
}
@@ -230,7 +231,8 @@ int main(int argc, char *argv[])
}
else {
size = 0;
- error = getpart(&type1_output, &size, "ntlm_auth_type1", "output", stream);
+ error = getpart(&type1_output, &size, "ntlm_auth_type1", "output",
+ stream);
fclose(stream);
if(error || size == 0) {
logmsg("getpart() type 1 output failed with error: %d", error);
@@ -251,7 +253,8 @@ int main(int argc, char *argv[])
}
else {
size = 0;
- error = getpart(&type3_output, &size, "ntlm_auth_type3", "output", stream);
+ error = getpart(&type3_output, &size, "ntlm_auth_type3", "output",
+ stream);
fclose(stream);
if(error || size == 0) {
logmsg("getpart() type 3 output failed with error: %d", error);