diff options
Diffstat (limited to 'tests/server/fake_ntlm.c')
-rw-r--r-- | tests/server/fake_ntlm.c | 17 |
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); |