attempt to regularize atoi mess.
[oweals/busybox.git] / networking / telnetd.c
index 1c4dede39acad02349b1ced1aa9df55d0b4dd46f..c6789e19c17c3fb0d150e9e4c2bf7980f7240c7f 100644 (file)
@@ -369,7 +369,7 @@ telnetd_main(int argc, char **argv)
        sockaddr_type sa;
        int master_fd;
        int on = 1;
-       int portnbr = 23;
+       unsigned portnbr = 23;
        struct in_addr bind_addr = { .s_addr = 0x0 };
        char *opt_portnbr, *opt_bindaddr;
 #endif /* CONFIG_FEATURE_TELNETD_INETD */
@@ -393,7 +393,7 @@ telnetd_main(int argc, char **argv)
        //if (opt & 1) // -f
        //if (opt & 2) // -l
 #ifndef CONFIG_FEATURE_TELNETD_INETD
-       if (opt & 4) portnbr = atoi(opt_portnbr); // -p
+       if (opt & 4) portnbr = xatou16(opt_portnbr); // -p
        if (opt & 8) // -b
                if (inet_aton(opt_bindaddr, &bind_addr) == 0) bb_show_usage();
 #endif /* CONFIG_FEATURE_TELNETD_INETD */