summaryrefslogtreecommitdiff
path: root/usr.sbin/httpd
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>1999-12-06 20:20:20 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>1999-12-06 20:20:20 +0000
commitd3b9409b407e8260362e3971b24683562285460a (patch)
tree7a7f0be321e7ff1637649116b5cc50ded1515b42 /usr.sbin/httpd
parent89a8fda5c250e1bd4af3c903ea59254c515fc537 (diff)
not MAXHOSTNAMELEN + 1
Diffstat (limited to 'usr.sbin/httpd')
-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);