From 1e2056fecb30c5184b70c5d6ad3becf9c200ac09 Mon Sep 17 00:00:00 2001 From: Julien Chaffraix Date: Sun, 26 Sep 2010 16:17:01 -0700 Subject: security.c: Fix ftp_send_command. My use of va_args was completely wrong. Fixed the usage so that we send the right commands! --- lib/security.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'lib/security.c') 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; } -- cgit v1.2.3