From 8d087ae4fbc9fa2da784e4e4f54ef153f512a68c Mon Sep 17 00:00:00 2001 From: Connor Lane Smith Date: Fri, 10 Jun 2011 02:00:27 +0100 Subject: [PATCH] cmp: cleanup --- cmp.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/cmp.c b/cmp.c index ee54752..3baa8d6 100644 --- a/cmp.c +++ b/cmp.c @@ -2,16 +2,13 @@ #include #include #include -#include #include -#include "util.h" - -static bool lflag = false; -static bool sflag = false; int main(int argc, char *argv[]) { + bool lflag = false; + bool sflag = false; bool same = true; char c; int b[2], i; @@ -30,12 +27,12 @@ main(int argc, char *argv[]) exit(2); } if(optind != argc-2) { - eprintf("usage: %s [-ls] file1 file2\n", argv[0]); + fprintf(stderr, "usage: %s [-ls] file1 file2\n", argv[0]); exit(2); } for(i = 0; i < 2; i++) if(!(fp[i] = fopen(argv[optind+i], "r"))) { - eprintf("fopen %s:", argv[optind+i]); + fprintf(stderr, "fopen %s:", argv[optind+i]); exit(2); } for(n = 1; ((b[0] = getc(fp[0])) != EOF) | ((b[1] = getc(fp[1])) != EOF); n++) {