From 832b780b4152848e2f144a06216506fff06f5005 Mon Sep 17 00:00:00 2001 From: deraadt Date: Thu, 2 Sep 2021 21:09:29 +0000 Subject: [PATCH] rather than using sys/param.h, define a local replacement MINIMUM() instead of MIN(), as done elsewhere --- usr.bin/ldap/ldapclient.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/usr.bin/ldap/ldapclient.c b/usr.bin/ldap/ldapclient.c index 9763b8eaaf2..a2cfb134f62 100644 --- a/usr.bin/ldap/ldapclient.c +++ b/usr.bin/ldap/ldapclient.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ldapclient.c,v 1.12 2019/01/26 10:58:54 deraadt Exp $ */ +/* $OpenBSD: ldapclient.c,v 1.13 2021/09/02 21:09:29 deraadt Exp $ */ /* * Copyright (c) 2018 Reyk Floeter @@ -16,7 +16,6 @@ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -#include #include #include #include @@ -57,6 +56,8 @@ #define LDIF_LINELENGTH 79 #define LDAPPASSMAX 1024 +#define MINIMUM(a, b) (((a) < (b)) ? (a) : (b)) + struct ldapc { struct aldap *ldap_al; char *ldap_host; @@ -455,7 +456,7 @@ ldapc_printattr(struct ldapc *ldap, const char *key, if (outlen > LDIF_LINELENGTH) outlen--; /* max. line length - newline - optional indent */ - left = MIN(inlen - outlen, outlen ? + left = MINIMUM(inlen - outlen, outlen ? LDIF_LINELENGTH - 2 : LDIF_LINELENGTH - 1); fwrite(p + outlen, left, 1, stdout); -- 2.20.1