From: ewt Date: Mon, 31 Mar 1997 20:15:23 +0000 (+0000) Subject: fixed \r\n stuff X-Git-Tag: tznext/4.11.0.1.tizen20130304~10445 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=e82919e6de7d1f661064c426b407c2901dfa2a24;p=tools%2Flibrpm-tizen.git fixed \r\n stuff CVS patchset: 1515 CVS date: 1997/03/31 20:15:23 --- diff --git a/ftp.c b/ftp.c index 9126acc..a64c930 100644 --- a/ftp.c +++ b/ftp.c @@ -152,7 +152,7 @@ int ftpCommand(int sock, char * command, ...) { int rc; va_start(ap, command); - len = strlen(command) + 1; + len = strlen(command) + 2; s = va_arg(ap, char *); while (s) { len += strlen(s) + 1; @@ -160,7 +160,7 @@ int ftpCommand(int sock, char * command, ...) { } va_end(ap); - buf = alloca(len + 2); + buf = alloca(len + 1); va_start(ap, command); strcpy(buf, command); @@ -173,8 +173,8 @@ int ftpCommand(int sock, char * command, ...) { } va_end(ap); - buf[len - 2] = '\n'; - buf[len - 1] = '\r'; + buf[len - 2] = '\r'; + buf[len - 1] = '\n'; buf[len] = '\0'; if (write(sock, buf, len) != len) { @@ -329,7 +329,7 @@ int ftpGetFileDesc(int sock, char * remotename) { char * retrCommand; int rc; - if (write(sock, "PASV\n\r", 6) != 5) { + if (write(sock, "PASV\r\n", 6) != 6) { return FTPERR_SERVER_IO_ERROR; } if ((rc = ftpCheckResponse(sock, &passReply))) @@ -374,7 +374,7 @@ int ftpGetFileDesc(int sock, char * remotename) { } retrCommand = alloca(strlen(remotename) + 20); - sprintf(retrCommand, "RETR %s\n\r", remotename); + sprintf(retrCommand, "RETR %s\r\n", remotename); i = strlen(retrCommand); if (write(sock, retrCommand, i) != i) {