[BusyBox] [patch] Fix deallocvt to handle no arguments

Erik Andersen andersen at lineo.com
Fri Sep 22 00:40:53 UTC 2000


On Thu Sep 21, 2000 at 02:55:25PM -0700, Jon McClintock wrote:
> Hello,
> 
> BusyBox's deallocvt has code for handling no arguments, but the usage checking
> code aborts if there are any other than two arguments. This patch fixes
> that:
> 
> --- deallocvt.c.orig    Thu Sep 21 14:15:07 2000
> +++ deallocvt.c Thu Sep 21 14:40:21 2000
> @@ -17,7 +17,7 @@
>  {
>         int fd, num, i;
> 
> -       if ((argc != 2) || (**(argv + 1) == '-'))
> +       if ((argc > 2) || ((argv == 2) && (**(argv + 1) == '-')))
>                 usage(deallocvt_usage);
> 
>         fd = get_console_fd("/dev/console");
> 
> 
> If you think my conditional is ugly, feel free to replace it with a pretty one.

Looks fine to me.  Applied,

 -Erik

--
Erik B. Andersen   email:  andersen at lineo.com
--This message was written using 73% post-consumer electrons--





More information about the busybox mailing list