]> granicus.if.org Git - php/commitdiff
- Fix the constant detection
authorFelipe Pena <felipe@php.net>
Sat, 13 Nov 2010 19:50:55 +0000 (19:50 +0000)
committerFelipe Pena <felipe@php.net>
Sat, 13 Nov 2010 19:50:55 +0000 (19:50 +0000)
Zend/zend_constants.c

index bae13eaf02c598c3bf340ab3c5901282caf63894..0d190b269a17d88c554b94302bd7b7367c8acbbd 100644 (file)
@@ -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);