-/* $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 <reyk@openbsd.org>
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
-#include <sys/param.h>
#include <sys/queue.h>
#include <sys/socket.h>
#include <sys/stat.h>
#define LDIF_LINELENGTH 79
#define LDAPPASSMAX 1024
+#define MINIMUM(a, b) (((a) < (b)) ? (a) : (b))
+
struct ldapc {
struct aldap *ldap_al;
char *ldap_host;
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);