diff options
author | vda <vda@69ca8d6d-28ef-0310-b511-8ec308f3f277> | 2006-10-08 12:49:22 +0000 |
---|---|---|
committer | vda <vda@69ca8d6d-28ef-0310-b511-8ec308f3f277> | 2006-10-08 12:49:22 +0000 |
commit | 87d25a2b8535dc627a02eb539fa3946be2a24647 (patch) | |
tree | fc4d14a910593d1235318bb36abe5e9f72d2039e /console-tools/chvt.c | |
parent | 81177b14907e73f11560f69e0b4ec34371f1a7d5 (diff) | |
download | busybox-w32-87d25a2b8535dc627a02eb539fa3946be2a24647.tar.gz busybox-w32-87d25a2b8535dc627a02eb539fa3946be2a24647.tar.bz2 busybox-w32-87d25a2b8535dc627a02eb539fa3946be2a24647.zip |
attempt to regularize atoi mess.
git-svn-id: svn://busybox.net/trunk/busybox@16342 69ca8d6d-28ef-0310-b511-8ec308f3f277
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"); |