summaryrefslogtreecommitdiff
path: root/bin/dd/conv.c
diff options
context:
space:
mode:
Diffstat (limited to 'bin/dd/conv.c')
-rw-r--r--bin/dd/conv.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/bin/dd/conv.c b/bin/dd/conv.c
index ba005a3e155..16aa5f1b8f3 100644
--- a/bin/dd/conv.c
+++ b/bin/dd/conv.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: conv.c,v 1.11 2009/10/27 23:59:21 deraadt Exp $ */
+/* $OpenBSD: conv.c,v 1.12 2015/01/16 06:39:31 deraadt Exp $ */
/* $NetBSD: conv.c,v 1.6 1996/02/20 19:29:02 jtc Exp $ */
/*-
@@ -34,7 +34,7 @@
* SUCH DAMAGE.
*/
-#include <sys/param.h>
+#include <sys/types.h>
#include <sys/time.h>
#include <err.h>
@@ -43,6 +43,8 @@
#include "dd.h"
#include "extern.h"
+#define MINIMUM(a, b) (((a) < (b)) ? (a) : (b))
+
/*
* def --
* Copy input to output. Input is buffered until reaches obs, and then
@@ -137,7 +139,7 @@ block(void)
* translation is done as we copy into the output buffer.
*/
for (inp = in.dbp - in.dbcnt, outp = out.dbp; in.dbcnt;) {
- maxlen = MIN(cbsz, in.dbcnt);
+ maxlen = MINIMUM(cbsz, in.dbcnt);
if ((t = ctab) != NULL)
for (cnt = 0;
cnt < maxlen && (ch = *inp++) != '\n'; ++cnt)