diff options
| author | Denys Vlasenko <vda.linux@googlemail.com> | 2010-04-03 14:59:12 +0200 |
|---|---|---|
| committer | Denys Vlasenko <vda.linux@googlemail.com> | 2010-04-03 14:59:12 +0200 |
| commit | 4a1884da5322dc9b6fec2b461fe0e8ca6425178a (patch) | |
| tree | faf4f085adf32fb13aededa224cc7e06122d6cb2 | |
| parent | 8a659f6ff9a364fb48fbfa95d70d09134b579627 (diff) | |
| download | busybox-w32-4a1884da5322dc9b6fec2b461fe0e8ca6425178a.tar.gz busybox-w32-4a1884da5322dc9b6fec2b461fe0e8ca6425178a.tar.bz2 busybox-w32-4a1884da5322dc9b6fec2b461fe0e8ca6425178a.zip | |
ftpd: shrink by 33 bytes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| -rw-r--r-- | networking/ftpd.c | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/networking/ftpd.c b/networking/ftpd.c index 7605d48f3..375cc0ca5 100644 --- a/networking/ftpd.c +++ b/networking/ftpd.c | |||
| @@ -981,17 +981,23 @@ handle_stou(void) | |||
| 981 | static uint32_t | 981 | static uint32_t |
| 982 | cmdio_get_cmd_and_arg(void) | 982 | cmdio_get_cmd_and_arg(void) |
| 983 | { | 983 | { |
| 984 | size_t len; | 984 | int len; |
| 985 | uint32_t cmdval; | 985 | uint32_t cmdval; |
| 986 | char *cmd; | 986 | char *cmd; |
| 987 | 987 | ||
| 988 | alarm(G.timeout); | 988 | alarm(G.timeout); |
| 989 | 989 | ||
| 990 | free(G.ftp_cmd); | 990 | free(G.ftp_cmd); |
| 991 | len = 8 * 1024; /* Paranoia. Peer may send 1 gigabyte long cmd... */ | 991 | { |
| 992 | G.ftp_cmd = cmd = xmalloc_fgets_str_len(stdin, "\r\n", &len); | 992 | /* Paranoia. Peer may send 1 gigabyte long cmd... */ |
| 993 | if (!cmd) | 993 | /* Using separate len_on_stk instead of len optimizes |
| 994 | exit(0); | 994 | * code size (allows len to be in CPU register) */ |
| 995 | size_t len_on_stk = 8 * 1024; | ||
| 996 | G.ftp_cmd = cmd = xmalloc_fgets_str_len(stdin, "\r\n", &len_on_stk); | ||
| 997 | if (!cmd) | ||
| 998 | exit(0); | ||
| 999 | len = len_on_stk; | ||
| 1000 | } | ||
| 995 | 1001 | ||
| 996 | /* De-escape telnet: 0xff,0xff => 0xff */ | 1002 | /* De-escape telnet: 0xff,0xff => 0xff */ |
| 997 | /* RFC959 says that ABOR, STAT, QUIT may be sent even during | 1003 | /* RFC959 says that ABOR, STAT, QUIT may be sent even during |
