svn: /php/php-src/ branches/PHP_5_3/ext/standard/dns.c branches/PHP_5_4/ext/standard/dns.c trunk/ext/standard/dns.c

From: Date: Wed, 10 Aug 2011 17:40:56 +0000
Subject: svn: /php/php-src/ branches/PHP_5_3/ext/standard/dns.c branches/PHP_5_4/ext/standard/dns.c trunk/ext/standard/dns.c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-65820@lists.php.net to get a copy of this message
rasmus Wed, 10 Aug 2011 17:40:56 +0000 Revision: http://svn.php.net/viewvc?view=revision&revision=314766 Log: Use HOST_NAME_MAX constant here instead for the gethostname() func Changed paths: U php/php-src/branches/PHP_5_3/ext/standard/dns.c U php/php-src/branches/PHP_5_4/ext/standard/dns.c U php/php-src/trunk/ext/standard/dns.c Modified: php/php-src/branches/PHP_5_3/ext/standard/dns.c =================================================================== --- php/php-src/branches/PHP_5_3/ext/standard/dns.c 2011-08-10 16:43:02 UTC (rev 314765) +++ php/php-src/branches/PHP_5_3/ext/standard/dns.c 2011-08-10 17:40:56 UTC (rev 314766) @@ -66,6 +66,12 @@ #define MAXHOSTNAMELEN 255 #endif +/* For the local hostname obtained via gethostname which is different from the + dns-related MAXHOSTNAMELEN constant above */ +#ifndef HOST_NAME_MAX +#define HOST_NAME_MAX 255 +#endif + #include "php_dns.h" /* type compat */ @@ -122,7 +128,7 @@ Get the host name of the current machine */ PHP_FUNCTION(gethostname) { - char buf[MAXHOSTNAMELEN]; + char buf[HOST_NAME_MAX]; if (zend_parse_parameters_none() == FAILURE) { return; Modified: php/php-src/branches/PHP_5_4/ext/standard/dns.c =================================================================== --- php/php-src/branches/PHP_5_4/ext/standard/dns.c 2011-08-10 16:43:02 UTC (rev 314765) +++ php/php-src/branches/PHP_5_4/ext/standard/dns.c 2011-08-10 17:40:56 UTC (rev 314766) @@ -66,6 +66,12 @@ #define MAXHOSTNAMELEN 255 #endif +/* For the local hostname obtained via gethostname which is different from the + dns-related MAXHOSTNAMELEN constant above */ +#ifndef HOST_NAME_MAX +#define HOST_NAME_MAX 255 +#endif + #include "php_dns.h" /* type compat */ @@ -122,7 +128,7 @@ Get the host name of the current machine */ PHP_FUNCTION(gethostname) { - char buf[MAXHOSTNAMELEN]; + char buf[HOST_NAME_MAX]; if (zend_parse_parameters_none() == FAILURE) { return; Modified: php/php-src/trunk/ext/standard/dns.c =================================================================== --- php/php-src/trunk/ext/standard/dns.c 2011-08-10 16:43:02 UTC (rev 314765) +++ php/php-src/trunk/ext/standard/dns.c 2011-08-10 17:40:56 UTC (rev 314766) @@ -66,6 +66,12 @@ #define MAXHOSTNAMELEN 255 #endif +/* For the local hostname obtained via gethostname which is different from the + dns-related MAXHOSTNAMELEN constant above */ +#ifndef HOST_NAME_MAX +#define HOST_NAME_MAX 255 +#endif + #include "php_dns.h" /* type compat */ @@ -122,7 +128,7 @@ Get the host name of the current machine */ PHP_FUNCTION(gethostname) { - char buf[MAXHOSTNAMELEN]; + char buf[HOST_NAME_MAX]; if (zend_parse_parameters_none() == FAILURE) { return;

« previous php.cvs (#65820) next »