aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorJulien Chaffraix <julien.chaffraix@gmail.com>2010-09-26 16:17:01 -0700
committerJulien Chaffraix <julien.chaffraix@gmail.com>2010-09-28 22:05:24 -0700
commit1e2056fecb30c5184b70c5d6ad3becf9c200ac09 (patch)
tree8c06029bebbfb04b312bf981e342ee4d7e589ee3 /lib
parent5df13c31735fa089d5344fde13b66ace1ea473d1 (diff)
security.c: Fix ftp_send_command.
My use of va_args was completely wrong. Fixed the usage so that we send the right commands!
Diffstat (limited to 'lib')
-rw-r--r--lib/security.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/security.c b/lib/security.c
index 693be3f57..570807811 100644
--- a/lib/security.c
+++ b/lib/security.c
@@ -128,9 +128,13 @@ static int ftp_send_command(struct connectdata *conn, const char *message, ...)
int ftp_code;
ssize_t nread;
va_list args;
+ char print_buffer[50];
va_start(args, message);
- if(Curl_ftpsendf(conn, message, args) != CURLE_OK) {
+ vsnprintf(print_buffer, sizeof(print_buffer), message, args);
+ va_end(args);
+
+ if(Curl_ftpsendf(conn, print_buffer) != CURLE_OK) {
ftp_code = -1;
}
else {
@@ -139,7 +143,6 @@ static int ftp_send_command(struct connectdata *conn, const char *message, ...)
}
(void)nread; /* Unused */
- va_end(args);
return ftp_code;
}