summaryrefslogtreecommitdiffstats
path: root/usr.bin/diff/diff.c
diff options
context:
space:
mode:
authormillert <millert@openbsd.org>2003-06-25 21:43:49 +0000
committermillert <millert@openbsd.org>2003-06-25 21:43:49 +0000
commit49dffe13d7fe900b7adc58a2f8d6809cffbe02d7 (patch)
tree11281c9540cd069a01afa492aa4d03de8c82fbf6 /usr.bin/diff/diff.c
parentdelete junk proto (diff)
downloadwireguard-openbsd-49dffe13d7fe900b7adc58a2f8d6809cffbe02d7.tar.xz
wireguard-openbsd-49dffe13d7fe900b7adc58a2f8d6809cffbe02d7.zip
o use S_ISDIR instead of doing it by hand
o rename talloc -> emalloc and ralloc -> erealloc o struct direct -> struct dirent (POSIX) o kill remaining strcpy() o fix unterminated string in setfile() deraadt@ OK
Diffstat (limited to 'usr.bin/diff/diff.c')
-rw-r--r--usr.bin/diff/diff.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/usr.bin/diff/diff.c b/usr.bin/diff/diff.c
index 09b9fe98b6a..3ae107214af 100644
--- a/usr.bin/diff/diff.c
+++ b/usr.bin/diff/diff.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: diff.c,v 1.7 2003/06/25 19:56:57 millert Exp $ */
+/* $OpenBSD: diff.c,v 1.8 2003/06/25 21:43:49 millert Exp $ */
/*
* Copyright (C) Caldera International Inc. 2001-2002.
@@ -142,10 +142,9 @@ main(int argc, char **argv)
stb2.st_mode = S_IFREG;
else if (stat(file2, &stb2) < 0)
err(1, "%s", file2);
- if ((stb1.st_mode & S_IFMT) == S_IFDIR &&
- (stb2.st_mode & S_IFMT) == S_IFDIR) {
+ if (S_ISDIR(stb1.st_mode) && S_ISDIR(stb2.st_mode))
diffdir(argv);
- } else
+ else
diffreg();
done(0);
}
@@ -175,7 +174,7 @@ done(int sig)
}
void *
-talloc(size_t n)
+emalloc(size_t n)
{
void *p;
@@ -185,7 +184,7 @@ talloc(size_t n)
}
void *
-ralloc(void *p, size_t n)
+erealloc(void *p, size_t n)
{
void *q;