projects
/
platform
/
upstream
/
curl.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
5df13c3
)
security.c: Fix ftp_send_command.
author
Julien Chaffraix
<julien.chaffraix@gmail.com>
Sun, 26 Sep 2010 23:17:01 +0000
(16:17 -0700)
committer
Julien Chaffraix
<julien.chaffraix@gmail.com>
Wed, 29 Sep 2010 05:05:24 +0000
(22:05 -0700)
My use of va_args was completely wrong. Fixed the usage so that
we send the right commands!
lib/security.c
patch
|
blob
|
history
diff --git
a/lib/security.c
b/lib/security.c
index
693be3f
..
5708078
100644
(file)
--- 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;
}