On Mon, Sep 6, 2010 at 4:19 PM, Sergey Naumov <[email protected]> wrote:
>> Please review attached version.
> All works fine except I can pass additional (3-rd) parameter at the
> end of commands which do not require an argument,
> for example ./busybox blockdev --rereadpt /dev/sda a.
> It could save some size, but original utility accepts blockdev
> --rereadpt /dev/sda /dev/sdb, so, from my point of view, we should
> inform user when he tries to provide such an input.
> So, I think, we should add
>
>   if (bdcmd->flags & FL_USRARG)
>       llu = xatoi_positive(*++argv);
> + else
> +     if (argc > 3) bb_show_usage();

This is smaller:

-       if (!*++argv)
+       if (!*++argv || argv[1])
                bb_show_usage();

Fixed in git, thanks!
-- 
vda
_______________________________________________
busybox mailing list
[email protected]
http://lists.busybox.net/mailman/listinfo/busybox

Reply via email to