aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGlenn L McGrath <bug1@ihug.co.nz>2004-01-14 07:34:37 +0000
committerGlenn L McGrath <bug1@ihug.co.nz>2004-01-14 07:34:37 +0000
commit6a78631164a5b3ba279fde20011aaefa1a89e7db (patch)
treec31d55977330aa15327e28813e96ba1c1ff11581
parent1cda715bbcaba253ffb81463f6b9260154e7a32d (diff)
downloadbusybox-w32-6a78631164a5b3ba279fde20011aaefa1a89e7db.tar.gz
busybox-w32-6a78631164a5b3ba279fde20011aaefa1a89e7db.tar.bz2
busybox-w32-6a78631164a5b3ba279fde20011aaefa1a89e7db.zip
Patch by Tito, use bb_xgetlarg, reduce size
-rw-r--r--console-tools/chvt.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/console-tools/chvt.c b/console-tools/chvt.c
index 4da0d6399..8ea062cde 100644
--- a/console-tools/chvt.c
+++ b/console-tools/chvt.c
@@ -36,12 +36,12 @@ int chvt_main(int argc, char **argv)
36{ 36{
37 int fd, num; 37 int fd, num;
38 38
39 if ((argc != 2) || (**(argv + 1) == '-')) { 39 if (argc != 2) {
40 bb_show_usage(); 40 bb_show_usage();
41 } 41 }
42 42
43 fd = get_console_fd(); 43 fd = get_console_fd();
44 num = atoi(argv[1]); 44 num = bb_xgetlarg(argv[1], 10, 0, INT_MAX);
45 if (ioctl(fd, VT_ACTIVATE, num)) { 45 if (ioctl(fd, VT_ACTIVATE, num)) {
46 bb_perror_msg_and_die("VT_ACTIVATE"); 46 bb_perror_msg_and_die("VT_ACTIVATE");
47 } 47 }