summaryrefslogtreecommitdiff
path: root/bin/cat/cat.c
diff options
context:
space:
mode:
Diffstat (limited to 'bin/cat/cat.c')
-rw-r--r--bin/cat/cat.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/bin/cat/cat.c b/bin/cat/cat.c
index 399db63d71a..857534e6eee 100644
--- a/bin/cat/cat.c
+++ b/bin/cat/cat.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cat.c,v 1.20 2009/10/27 23:59:19 deraadt Exp $ */
+/* $OpenBSD: cat.c,v 1.21 2015/01/16 06:39:28 deraadt Exp $ */
/* $NetBSD: cat.c,v 1.11 1995/09/07 06:12:54 jtc Exp $ */
/*
@@ -33,7 +33,7 @@
* SUCH DAMAGE.
*/
-#include <sys/param.h>
+#include <sys/types.h>
#include <sys/stat.h>
#include <ctype.h>
@@ -46,6 +46,8 @@
#include <string.h>
#include <unistd.h>
+#define MAXIMUM(a, b) (((a) > (b)) ? (a) : (b))
+
extern char *__progname;
int bflag, eflag, nflag, sflag, tflag, vflag;
@@ -227,7 +229,7 @@ raw_cat(int rfd)
if (buf == NULL) {
if (fstat(wfd, &sbuf))
err(1, "stdout");
- bsize = MAX(sbuf.st_blksize, BUFSIZ);
+ bsize = MAXIMUM(sbuf.st_blksize, BUFSIZ);
if ((buf = malloc(bsize)) == NULL)
err(1, "malloc");
}