> 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();
Very educational code, thanks =)
Sergey Naumov.
blockdev.c
Description: Binary data
_______________________________________________ busybox mailing list [email protected] http://lists.busybox.net/mailman/listinfo/busybox
