summaryrefslogtreecommitdiff
path: root/usr.bin/cmp/regular.c
diff options
context:
space:
mode:
Diffstat (limited to 'usr.bin/cmp/regular.c')
-rw-r--r--usr.bin/cmp/regular.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/usr.bin/cmp/regular.c b/usr.bin/cmp/regular.c
index 95ebc1bbbe0..f95f64e1e2b 100644
--- a/usr.bin/cmp/regular.c
+++ b/usr.bin/cmp/regular.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: regular.c,v 1.10 2011/01/19 13:01:25 okan Exp $ */
+/* $OpenBSD: regular.c,v 1.11 2015/01/16 06:40:06 deraadt Exp $ */
/* $NetBSD: regular.c,v 1.2 1995/09/08 03:22:59 tls Exp $ */
/*-
@@ -30,7 +30,6 @@
* SUCH DAMAGE.
*/
-#include <sys/param.h>
#include <sys/mman.h>
#include <sys/stat.h>
@@ -42,6 +41,8 @@
#include "extern.h"
+#define MINIMUM(a, b) (((a) < (b)) ? (a) : (b))
+
void
c_regular(int fd1, char *file1, off_t skip1, off_t len1,
int fd2, char *file2, off_t skip2, off_t len2)
@@ -60,7 +61,7 @@ c_regular(int fd1, char *file1, off_t skip1, off_t len1,
eofmsg(file2);
len2 -= skip2;
- length = MIN(len1, len2);
+ length = MINIMUM(len1, len2);
if (length > SIZE_T_MAX) {
mmap_failed:
c_special(fd1, file1, skip1, fd2, file2, skip2);