You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by ma...@hyperreal.org on 2000/01/12 21:58:06 UTC
cvs commit: apache-1.3/src/main util.c
marc 00/01/12 12:58:00
Modified: src/main util.c
Log:
Fixup sizing of a string to be more intuitive and consistent. The
only functional change that this introduces is to bump down the
maximum hostname length by one, to what it should be.
Submitted by: Theo de Raadt <de...@cvs.openbsd.org>
Revision Changes Path
1.176 +2 -2 apache-1.3/src/main/util.c
Index: util.c
===================================================================
RCS file: /export/home/cvs/apache-1.3/src/main/util.c,v
retrieving revision 1.175
retrieving revision 1.176
diff -u -r1.175 -r1.176
--- util.c 1999/12/01 20:55:03 1.175
+++ util.c 2000/01/12 20:57:48 1.176
@@ -1937,7 +1937,7 @@
#ifndef MAXHOSTNAMELEN
#define MAXHOSTNAMELEN 256
#endif
- char str[MAXHOSTNAMELEN + 1];
+ char str[MAXHOSTNAMELEN];
char *server_hostname;
struct hostent *p;
@@ -1949,7 +1949,7 @@
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);