diff options
Diffstat (limited to 'console-tools/chvt.c')
-rw-r--r-- | console-tools/chvt.c | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/console-tools/chvt.c b/console-tools/chvt.c index aff66e007..bbc5a9c31 100644 --- a/console-tools/chvt.c +++ b/console-tools/chvt.c | |||
@@ -7,11 +7,6 @@ | |||
7 | * Licensed under GPLv2 or later, see file LICENSE in this tarball for details. | 7 | * Licensed under GPLv2 or later, see file LICENSE in this tarball for details. |
8 | */ | 8 | */ |
9 | 9 | ||
10 | #include <stdio.h> | ||
11 | #include <stdlib.h> | ||
12 | #include <fcntl.h> | ||
13 | #include <sys/types.h> | ||
14 | #include <sys/ioctl.h> | ||
15 | #include "busybox.h" | 10 | #include "busybox.h" |
16 | 11 | ||
17 | /* From <linux/vt.h> */ | 12 | /* From <linux/vt.h> */ |
@@ -29,7 +24,7 @@ int chvt_main(int argc, char **argv) | |||
29 | } | 24 | } |
30 | 25 | ||
31 | fd = get_console_fd(); | 26 | fd = get_console_fd(); |
32 | num = bb_xgetlarg(argv[1], 10, 0, INT_MAX); | 27 | num = xatoul_range(argv[1], 1, 63); |
33 | if ((-1 == ioctl(fd, VT_ACTIVATE, num)) | 28 | if ((-1 == ioctl(fd, VT_ACTIVATE, num)) |
34 | || (-1 == ioctl(fd, VT_WAITACTIVE, num))) { | 29 | || (-1 == ioctl(fd, VT_WAITACTIVE, num))) { |
35 | bb_perror_msg_and_die("ioctl"); | 30 | bb_perror_msg_and_die("ioctl"); |