svn commit: trunk/busybox/coreutils

vda at busybox.net vda at busybox.net
Mon Aug 6 12:28:25 UTC 2007


Author: vda
Date: 2007-08-06 05:28:24 -0700 (Mon, 06 Aug 2007)
New Revision: 19411

Log:
catv: catv without arguments was trying to use environ as argv.
(Alex Landau <landau_alex at yahoo.com>)



Modified:
   trunk/busybox/coreutils/catv.c


Changeset:
Modified: trunk/busybox/coreutils/catv.c
===================================================================
--- trunk/busybox/coreutils/catv.c	2007-08-06 12:18:01 UTC (rev 19410)
+++ trunk/busybox/coreutils/catv.c	2007-08-06 12:28:24 UTC (rev 19411)
@@ -15,7 +15,8 @@
 int catv_main(int argc, char **argv);
 int catv_main(int argc, char **argv)
 {
-	int retval = EXIT_SUCCESS, fd;
+	int retval = EXIT_SUCCESS;
+	int fd;
 	unsigned flags;
 
 	flags = getopt32(argc, argv, "etv");
@@ -27,8 +28,10 @@
 
 	/* Read from stdin if there's nothing else to do. */
 	fd = 0;
-	if (!argv[0])
+	if (!argv[0]) {
+		argv--;
 		goto jump_in;
+	}
 	do {
 		fd = open_or_warn(*argv, O_RDONLY);
 		if (fd < 0) {
@@ -46,7 +49,7 @@
 			if (res < 1)
 				break;
 			for (i = 0; i < res; i++) {
-				char c = read_buf[i];
+				unsigned char c = read_buf[i];
 
 				if (c > 126 && (flags & CATV_OPT_v)) {
 					if (c == 127) {




More information about the busybox-cvs mailing list