summaryrefslogtreecommitdiff
path: root/usr.bin/cmp/cmp.c
diff options
context:
space:
mode:
Diffstat (limited to 'usr.bin/cmp/cmp.c')
-rw-r--r--usr.bin/cmp/cmp.c29
1 files changed, 5 insertions, 24 deletions
diff --git a/usr.bin/cmp/cmp.c b/usr.bin/cmp/cmp.c
index 4301731..eed0b52 100644
--- a/usr.bin/cmp/cmp.c
+++ b/usr.bin/cmp/cmp.c
@@ -29,20 +29,6 @@
* SUCH DAMAGE.
*/
-#include <sys/cdefs.h>
-#ifndef lint
-__COPYRIGHT("@(#) Copyright (c) 1987, 1990, 1993, 1994\
- The Regents of the University of California. All rights reserved.");
-#endif /* not lint */
-
-#ifndef lint
-#if 0
-static char sccsid[] = "@(#)cmp.c 8.3 (Berkeley) 4/2/94";
-#else
-__RCSID("$NetBSD: cmp.c,v 1.20 2016/10/30 19:33:49 christos Exp $");
-#endif
-#endif /* not lint */
-
#include <sys/types.h>
#include <sys/stat.h>
@@ -51,6 +37,7 @@ __RCSID("$NetBSD: cmp.c,v 1.20 2016/10/30 19:33:49 christos Exp $");
#include <fcntl.h>
#include <stdio.h>
#include <stdlib.h>
+#include <bsd/stdlib.h>
#include <string.h>
#include <unistd.h>
#include <locale.h>
@@ -59,7 +46,7 @@ __RCSID("$NetBSD: cmp.c,v 1.20 2016/10/30 19:33:49 christos Exp $");
int lflag, sflag;
-__dead static void usage(void);
+static void usage(void);
int
main(int argc, char *argv[])
@@ -72,11 +59,8 @@ main(int argc, char *argv[])
setlocale(LC_ALL, "");
special = 0;
- while ((ch = getopt(argc, argv, "cls")) != -1)
+ while ((ch = getopt(argc, argv, "ls")) != -1)
switch (ch) {
- case 'c':
- special = 1; /* careful! Don't use mmap() */
- break;
case 'l': /* print all differences */
lflag = 1;
break;
@@ -108,9 +92,6 @@ main(int argc, char *argv[])
exit(ERR_EXIT);
}
if (strcmp(file2 = argv[1], "-") == 0) {
- if (special)
- errx(ERR_EXIT,
- "standard input may only be specified once");
special = 1;
fd2 = 0;
file2 = "stdin";
@@ -125,12 +106,12 @@ main(int argc, char *argv[])
char *ep;
errno = 0;
- skip1 = strtoq(argv[2], &ep, 0);
+ skip1 = strtoll(argv[2], &ep, 0);
if (errno || ep == argv[2])
usage();
if (argc == 4) {
- skip2 = strtoq(argv[3], &ep, 0);
+ skip2 = strtoll(argv[3], &ep, 0);
if (errno || ep == argv[3])
usage();
}