ntpd: explain why scripts can be run in quick succession
[oweals/busybox.git] / networking / ftpgetput.c
index be3d5a673c32429d97bae841f2d89a17e5eb3481..2dd7e92328b0e7a1e1e6455e6b9977216fceb425 100644 (file)
@@ -27,7 +27,7 @@ struct globals {
 #define G (*(struct globals*)&bb_common_bufsiz1)
 enum { BUFSZ = COMMON_BUFSIZE - offsetof(struct globals, buf) };
 struct BUG_G_too_big {
-        char BUG_G_too_big[sizeof(G) <= COMMON_BUFSIZE ? 1 : -1];
+       char BUG_G_too_big[sizeof(G) <= COMMON_BUFSIZE ? 1 : -1];
 };
 #define user           (G.user          )
 #define password       (G.password      )
@@ -36,11 +36,10 @@ struct BUG_G_too_big {
 #define verbose_flag   (G.verbose_flag  )
 #define do_continue    (G.do_continue   )
 #define buf            (G.buf           )
-#define INIT_G() do { \
-} while (0)
+#define INIT_G() do { } while (0)
 
 
-static void ftp_die(const char *msg) ATTRIBUTE_NORETURN;
+static void ftp_die(const char *msg) NORETURN;
 static void ftp_die(const char *msg)
 {
        char *cp = buf; /* buf holds peer's response */
@@ -213,7 +212,7 @@ int ftp_receive(const char *local_path, char *server_path)
        }
 
        if (do_continue) {
-               sprintf(buf, "REST %"OFF_FMT"d", beg_range);
+               sprintf(buf, "REST %"OFF_FMT"u", beg_range);
                if (ftpcmd(buf, NULL) != 350) {
                        do_continue = 0;
                }
@@ -277,7 +276,7 @@ static const char ftpgetput_longopts[] ALIGN1 =
 #endif
 
 int ftpgetput_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
-int ftpgetput_main(int argc ATTRIBUTE_UNUSED, char **argv)
+int ftpgetput_main(int argc UNUSED_PARAM, char **argv)
 {
        unsigned opt;
        const char *port = "ftp";
@@ -307,7 +306,7 @@ int ftpgetput_main(int argc ATTRIBUTE_UNUSED, char **argv)
 #if ENABLE_FEATURE_FTPGETPUT_LONG_OPTIONS
        applet_long_options = ftpgetput_longopts;
 #endif
-       opt_complementary = "=3:vv:cc"; /* must have 3 params; -v and -c count */
+       opt_complementary = "-2:vv:cc"; /* must have 2 to 3 params; -v and -c count */
        opt = getopt32(argv, "cvu:p:P:", &user, &password, &port,
                                        &verbose_flag, &do_continue);
        argv += optind;
@@ -322,5 +321,5 @@ int ftpgetput_main(int argc ATTRIBUTE_UNUSED, char **argv)
        }
 
        ftp_login();
-       return ftp_action(argv[1], argv[2]);
+       return ftp_action(argv[1], argv[2] ? argv[2] : argv[1]);
 }