[BusyBox-cvs] busybox/console-tools chvt.c,1.20,1.21

Glenn McGrath bug1 at busybox.net
Wed Jan 14 07:34:40 UTC 2004


Update of /var/cvs/busybox/console-tools
In directory nail:/tmp/cvs-serv23243/console-tools

Modified Files:
	chvt.c 
Log Message:
Patch by Tito, use bb_xgetlarg, reduce size


Index: chvt.c
===================================================================
RCS file: /var/cvs/busybox/console-tools/chvt.c,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -d -r1.20 -r1.21
--- chvt.c	22 Oct 2003 10:30:53 -0000	1.20
+++ chvt.c	14 Jan 2004 07:34:37 -0000	1.21
@@ -36,12 +36,12 @@
 {
 	int fd, num;
 
-	if ((argc != 2) || (**(argv + 1) == '-')) {
+	if (argc != 2) {
 		bb_show_usage();
 	}
 
 	fd = get_console_fd();
-	num = atoi(argv[1]);
+	num =  bb_xgetlarg(argv[1], 10, 0, INT_MAX);
 	if (ioctl(fd, VT_ACTIVATE, num)) {
 		bb_perror_msg_and_die("VT_ACTIVATE");
 	}




More information about the busybox-cvs mailing list