File: complain-about-non-option-arguments

package info (click to toggle)
buffer 1.19-12
  • links: PTS
  • area: main
  • in suites: bookworm, bullseye, buster, jessie, jessie-kfreebsd, stretch
  • size: 500 kB
  • sloc: ansic: 8,475; makefile: 124; sh: 35
file content (14 lines) | stat: -rw-r--r-- 207 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
--- a/buffer.c
+++ b/buffer.c
@@ -397,6 +397,11 @@
 			byee( -1 );
 		}
 	}
+	
+	if (argc > optind) {
+		fprintf( stderr, "too many arguments\n" );
+		byee( -1 );
+	}
 
 	if (zflag) showevery = blocksize;