aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--coreutils/catv.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/coreutils/catv.c b/coreutils/catv.c
index 876b67a2a..0ca73a0c9 100644
--- a/coreutils/catv.c
+++ b/coreutils/catv.c
@@ -15,7 +15,8 @@
15int catv_main(int argc, char **argv); 15int catv_main(int argc, char **argv);
16int catv_main(int argc, char **argv) 16int catv_main(int argc, char **argv)
17{ 17{
18 int retval = EXIT_SUCCESS, fd; 18 int retval = EXIT_SUCCESS;
19 int fd;
19 unsigned flags; 20 unsigned flags;
20 21
21 flags = getopt32(argc, argv, "etv"); 22 flags = getopt32(argc, argv, "etv");
@@ -27,8 +28,10 @@ int catv_main(int argc, char **argv)
27 28
28 /* Read from stdin if there's nothing else to do. */ 29 /* Read from stdin if there's nothing else to do. */
29 fd = 0; 30 fd = 0;
30 if (!argv[0]) 31 if (!argv[0]) {
32 argv--;
31 goto jump_in; 33 goto jump_in;
34 }
32 do { 35 do {
33 fd = open_or_warn(*argv, O_RDONLY); 36 fd = open_or_warn(*argv, O_RDONLY);
34 if (fd < 0) { 37 if (fd < 0) {
@@ -46,7 +49,7 @@ int catv_main(int argc, char **argv)
46 if (res < 1) 49 if (res < 1)
47 break; 50 break;
48 for (i = 0; i < res; i++) { 51 for (i = 0; i < res; i++) {
49 char c = read_buf[i]; 52 unsigned char c = read_buf[i];
50 53
51 if (c > 126 && (flags & CATV_OPT_v)) { 54 if (c > 126 && (flags & CATV_OPT_v)) {
52 if (c == 127) { 55 if (c == 127) {