summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorderaadt <deraadt@openbsd.org>1999-12-06 20:20:19 +0000
committerderaadt <deraadt@openbsd.org>1999-12-06 20:20:19 +0000
commitf0360074600e2b375b04238c08d8a96d5c0dff03 (patch)
tree2fffca2d5978fa178de62b521710ccfdf12e9623
parentmove atomicio into it's own file. wrap all socket write()s which were doing (diff)
downloadwireguard-openbsd-f0360074600e2b375b04238c08d8a96d5c0dff03.tar.xz
wireguard-openbsd-f0360074600e2b375b04238c08d8a96d5c0dff03.zip
not MAXHOSTNAMELEN + 1
-rw-r--r--usr.sbin/httpd/src/main/util.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/usr.sbin/httpd/src/main/util.c b/usr.sbin/httpd/src/main/util.c
index b358501c077..771ad400030 100644
--- a/usr.sbin/httpd/src/main/util.c
+++ b/usr.sbin/httpd/src/main/util.c
@@ -1934,7 +1934,7 @@ char *ap_get_local_host(pool *a)
#ifndef MAXHOSTNAMELEN
#define MAXHOSTNAMELEN 256
#endif
- char str[MAXHOSTNAMELEN + 1];
+ char str[MAXHOSTNAMELEN];
char *server_hostname;
struct hostent *p;
@@ -1946,7 +1946,7 @@ char *ap_get_local_host(pool *a)
perror("Unable to gethostname");
exit(1);
}
- str[MAXHOSTNAMELEN] = '\0';
+ str[sizeof(str)-1] = '\0';
if ((!(p = gethostbyname(str))) || (!(server_hostname = find_fqdn(a, p)))) {
fprintf(stderr, "%s: cannot determine local host name.\n",
ap_server_argv0);