small ipv6 doc changes; nslookup a tiny bit smaller
[oweals/busybox.git] / networking / tftp.c
index 42fd9d2cac73c114cbbd0b9286e32458e1c807bb..6213d662271a2d6698312ecb347a5c78b44daa46 100644 (file)
@@ -373,7 +373,7 @@ static int tftp(const int cmd, const struct hostent *host,
                                res = tftp_option_get(&buf[2], len - 2, OPTION_BLOCKSIZE);
 
                                if (res) {
-                                       int blksize = atoi(res);
+                                       int blksize = xatoi_u(res);
 
                                        if (tftp_blocksize_check(blksize, tftp_bufsize - 4)) {
 
@@ -497,14 +497,12 @@ int tftp_main(int argc, char **argv)
 #endif
 
 #if defined(CONFIG_FEATURE_TFTP_GET) && defined(CONFIG_FEATURE_TFTP_PUT)
-       bb_opt_complementally = GET_COMPL PUT_COMPL ":?g--p:p--g";
+       opt_complementary = GET_COMPL PUT_COMPL ":?g--p:p--g";
 #elif defined(CONFIG_FEATURE_TFTP_GET) || defined(CONFIG_FEATURE_TFTP_PUT)
-       bb_opt_complementally = GET_COMPL PUT_COMPL;
+       opt_complementary = GET_COMPL PUT_COMPL;
 #endif
 
-
-       cmd = bb_getopt_ulflags(argc, argv, GET PUT "l:r:" BS,
-                                                       &localfile, &remotefile BS_ARG);
+       cmd = getopt32(argc, argv, GET PUT "l:r:" BS, &localfile, &remotefile BS_ARG);
 
        cmd &= (tftp_cmd_get | tftp_cmd_put);
 #ifdef CONFIG_FEATURE_TFTP_GET
@@ -518,7 +516,7 @@ int tftp_main(int argc, char **argv)
 
 #ifdef CONFIG_FEATURE_TFTP_BLOCKSIZE
        if (sblocksize) {
-               blocksize = atoi(sblocksize);
+               blocksize = xatoi_u(sblocksize);
                if (!tftp_blocksize_check(blocksize, 0)) {
                        return EXIT_FAILURE;
                }
@@ -559,5 +557,5 @@ int tftp_main(int argc, char **argv)
                if (cmd == tftp_cmd_get && result != EXIT_SUCCESS)
                        unlink(localfile);
        }
-       return (result);
+       return result;
 }