summaryrefslogtreecommitdiffstats
path: root/usr.bin/diff/diffreg.c
diff options
context:
space:
mode:
authortedu <tedu@openbsd.org>2003-09-07 07:53:01 +0000
committertedu <tedu@openbsd.org>2003-09-07 07:53:01 +0000
commited58cb82bc4d1854fc0f8c8eb4572440927abcec (patch)
tree346bb8529a5fb642793230ad6e0a0d87a1170ec3 /usr.bin/diff/diffreg.c
parentfix crash. pr3454 from openbsd at rukh.net. ok deraadt@ (diff)
downloadwireguard-openbsd-ed58cb82bc4d1854fc0f8c8eb4572440927abcec.tar.xz
wireguard-openbsd-ed58cb82bc4d1854fc0f8c8eb4572440927abcec.zip
correct ascii file test. ok deraadt@ pb@
Diffstat (limited to 'usr.bin/diff/diffreg.c')
-rw-r--r--usr.bin/diff/diffreg.c9
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);
}