From: Felipe Pena Date: Sat, 13 Nov 2010 19:50:55 +0000 (+0000) Subject: - Fix the constant detection X-Git-Tag: php-5.3.4RC1~35 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=a0ccf0f14a630f9e806e8fbcae0d0dce875aac81;p=php - Fix the constant detection --- diff --git a/Zend/zend_constants.c b/Zend/zend_constants.c index bae13eaf02..0d190b269a 100644 --- a/Zend/zend_constants.c +++ b/Zend/zend_constants.c @@ -440,7 +440,7 @@ ZEND_API int zend_register_constant(zend_constant *c TSRMLS_DC) || zend_hash_add(EG(zend_constants), name, c->name_len, (void *) c, sizeof(zend_constant), NULL)==FAILURE) { /* The internal __COMPILER_HALT_OFFSET__ is prefixed by NULL byte */ - if (strncmp(name+1, "__COMPILER_HALT_OFFSET__", sizeof("__COMPILER_HALT_OFFSET__")) == 0) { + if (memcmp(name, "\0__COMPILER_HALT_OFFSET__", sizeof("\0__COMPILER_HALT_OFFSET__")) == 0) { name++; } zend_error(E_NOTICE,"Constant %s already defined", name);