#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 )
#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 */
}
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;
}
#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";
#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;
}
ftp_login();
- return ftp_action(argv[1], argv[2]);
+ return ftp_action(argv[1], argv[2] ? argv[2] : argv[1]);
}