From 1385899416a4396385ad421ae1f532be7103738a Mon Sep 17 00:00:00 2001 From: Denis Vlasenko Date: Sun, 8 Oct 2006 12:49:22 +0000 Subject: attempt to regularize atoi mess. --- console-tools/deallocvt.c | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-) (limited to 'console-tools/deallocvt.c') diff --git a/console-tools/deallocvt.c b/console-tools/deallocvt.c index b2e8e2bef..cd581b1c8 100644 --- a/console-tools/deallocvt.c +++ b/console-tools/deallocvt.c @@ -10,11 +10,6 @@ /* no options, no getopt */ -#include -#include -#include -#include -#include #include "busybox.h" /* From */ @@ -26,15 +21,13 @@ int deallocvt_main(int argc, char *argv[]) int num = 0; switch (argc) { - case 2: - if ((num = bb_xgetlarg(argv[1], 10, 0, INT_MAX)) == 0) { - bb_error_msg_and_die("0: illegal VT number"); - } + case 2: + num = xatoul_range(argv[1], 1, 63); /* Fallthrough */ - case 1: - break; - default: - bb_show_usage(); + case 1: + break; + default: + bb_show_usage(); } if (-1 == ioctl(get_console_fd(), VT_DISALLOCATE, num)) { -- cgit v1.2.3