libbb: make bb_lookup_port() abort on bad port names

Also, no need to preserve errno

function                                             old     new   delta
.rodata                                           104247  104241      -6
bb_lookup_port                                        97      83     -14
nc_main                                             1039    1018     -21
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 0/3 up/down: 0/-41)             Total: -41 bytes

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
This commit is contained in:
Denys Vlasenko
2021-09-09 22:00:44 +02:00
parent 82c5eb8e46
commit 7ab9cd2398
4 changed files with 10 additions and 22 deletions

View File

@ -290,8 +290,7 @@ static const char ftpgetput_longopts[] ALIGN1 =
int ftpgetput_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
int ftpgetput_main(int argc UNUSED_PARAM, char **argv)
{
const char *port = "ftp";
/* socket to ftp server */
const char *port = NULL;
#if ENABLE_FTPPUT && !ENABLE_FTPGET
# define ftp_action ftp_send