diff options
author | Ted Unangst <tedu@cvs.openbsd.org> | 2003-09-07 07:53:02 +0000 |
---|---|---|
committer | Ted Unangst <tedu@cvs.openbsd.org> | 2003-09-07 07:53:02 +0000 |
commit | 8da91410af0718410e112d3f98e0f9036c332627 (patch) | |
tree | 41767fa99dfbab8eb6ade13e531446ea9241eb2e | |
parent | dff5c370f855097d153ae1aa6c09261cd6513044 (diff) |
correct ascii file test. ok deraadt@ pb@
-rw-r--r-- | usr.bin/diff/diffreg.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/usr.bin/diff/diffreg.c b/usr.bin/diff/diffreg.c index b21c4815f3c..64dc10dbf26 100644 --- a/usr.bin/diff/diffreg.c +++ b/usr.bin/diff/diffreg.c @@ -1,4 +1,4 @@ -/* $OpenBSD: diffreg.c,v 1.49 2003/08/13 20:44:15 millert Exp $ */ +/* $OpenBSD: diffreg.c,v 1.50 2003/09/07 07:53:01 tedu Exp $ */ /* * Copyright (C) Caldera International Inc. 2001-2002. @@ -65,7 +65,7 @@ */ #ifndef lint -static const char rcsid[] = "$OpenBSD: diffreg.c,v 1.49 2003/08/13 20:44:15 millert Exp $"; +static const char rcsid[] = "$OpenBSD: diffreg.c,v 1.50 2003/09/07 07:53:01 tedu Exp $"; #endif /* not lint */ #include <sys/param.h> @@ -1212,7 +1212,7 @@ readhash(FILE *f) int asciifile(FILE *f) { - char buf[BUFSIZ], *cp; + char buf[BUFSIZ]; int i, cnt; if (aflag || f == NULL) @@ -1220,9 +1220,8 @@ asciifile(FILE *f) rewind(f); cnt = fread(buf, 1, sizeof(buf), f); - cp = buf; for (i = 0; i < cnt; i++) - if (!isprint(*cp) && !isspace(*cp)) + if (!isprint(buf[i]) && !isspace(buf[i])) return (0); return (1); } |