diff options
Diffstat (limited to 'server.c')
-rw-r--r-- | server.c | 11 |
1 files changed, 7 insertions, 4 deletions
@@ -1,7 +1,7 @@ -/* $OpenBSD: server.c,v 1.50 2015/01/06 14:07:48 reyk Exp $ */ +/* $OpenBSD: server.c,v 1.52 2015/01/16 06:40:17 deraadt Exp $ */ /* - * Copyright (c) 2006 - 2014 Reyk Floeter <reyk@openbsd.org> + * Copyright (c) 2006 - 2015 Reyk Floeter <reyk@openbsd.org> * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above @@ -16,6 +16,7 @@ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ +#include <sys/param.h> /* nitems */ #include <sys/types.h> #include <sys/queue.h> #include <sys/time.h> @@ -45,6 +46,8 @@ #include "httpd.h" +#define MINIMUM(a, b) (((a) < (b)) ? (a) : (b)) + int server_dispatch_parent(int, struct privsep_proc *, struct imsg *); int server_dispatch_logger(int, struct privsep_proc *, @@ -569,7 +572,7 @@ server_tls_readcb(int fd, short event, void *arg) } if (bufev->wm_read.high != 0) - howmuch = MIN(sizeof(rbuf), bufev->wm_read.high); + howmuch = MINIMUM(sizeof(rbuf), bufev->wm_read.high); ret = tls_read(clt->clt_tls_ctx, rbuf, howmuch, &len); if (ret == TLS_READ_AGAIN || ret == TLS_WRITE_AGAIN) { @@ -1025,7 +1028,7 @@ server_sendlog(struct server_config *srv_conf, int cmd, const char *emsg, ...) void server_log(struct client *clt, const char *msg) { - char ibuf[MAXHOSTNAMELEN], obuf[MAXHOSTNAMELEN]; + char ibuf[HOST_NAME_MAX+1], obuf[HOST_NAME_MAX+1]; struct server_config *srv_conf = clt->clt_srv_conf; char *ptr = NULL; int debug_cmd = -1; |