Fix kbuild bugs noticed by Bernhard Fischer <rep.nop@aon.at>
[oweals/busybox.git] / networking / tftp.c
index 5f0c190e2d4f74dc9adea9684350c291fb174163..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)) {
 
@@ -502,9 +502,7 @@ int tftp_main(int argc, char **argv)
        opt_complementary = GET_COMPL PUT_COMPL;
 #endif
 
-
-       cmd = getopt32(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;
 }