aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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;
}