gzip cleanup part #8
[oweals/busybox.git] / networking / telnet.c
index fd0f84d50f86ecfb4d18069dd931915e0eadd9fc..e65b6918d8d9f8eb9df0a2b2142050d8f2a43bf7 100644 (file)
@@ -103,7 +103,7 @@ static void telopt(byte c);
 static int subneg(byte c);
 
 /* Some globals */
-static int one = 1;
+static const int one = 1;
 
 #ifdef CONFIG_FEATURE_TELNET_TTYPE
 static char *ttype;
@@ -320,7 +320,7 @@ static void putiac_subopt(byte c, char *str)
        putiac(c);
        putiac(0);
 
-       while(*str)
+       while (*str)
                putiac(*str++);
 
        putiac(IAC);
@@ -343,12 +343,12 @@ static void putiac_subopt_autologin(void)
        putiac(TELQUAL_IS);
        putiac(NEW_ENV_VAR);
 
-       while(*user)
+       while (*user)
                putiac(*user++);
 
        putiac(NEW_ENV_VALUE);
 
-       while(*autologin)
+       while (*autologin)
                putiac(*autologin++);
 
        putiac(IAC);
@@ -607,7 +607,7 @@ int telnet_main(int argc, char** argv)
 #endif
 
 #ifdef CONFIG_FEATURE_TELNET_TTYPE
-    ttype = getenv("TERM");
+       ttype = getenv("TERM");
 #endif
 
        memset(&G, 0, sizeof G);
@@ -623,7 +623,7 @@ int telnet_main(int argc, char** argv)
                bb_show_usage();
 
 #ifdef CONFIG_FEATURE_TELNET_AUTOLOGIN
-       if (1 & bb_getopt_ulflags(argc, argv, "al:", &autologin))
+       if (1 & getopt32(argc, argv, "al:", &autologin))
                autologin = getenv("USER");
 
        if (optind < argc) {
@@ -639,7 +639,7 @@ int telnet_main(int argc, char** argv)
        s_in.sin_port = bb_lookup_port((argc == 3) ? argv[2] : "telnet", "tcp", 23);
 #endif
 
-       G.netfd = xconnect(&s_in);
+       G.netfd = xconnect_tcp_v4(&s_in);
 
        setsockopt(G.netfd, SOL_SOCKET, SO_KEEPALIVE, &one, sizeof one);