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 <[EMAIL PROTECTED]> 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);