mirror of
https://github.com/php/php-src.git
synced 2024-12-01 13:54:10 +08:00
Fixed extra byte allocation in constant creation code.
This commit is contained in:
parent
7f9d1a1f6b
commit
f341b2f381
@ -149,8 +149,8 @@ PHP_FUNCTION(ncurses_init)
|
||||
c.value = *zscr;
|
||||
zval_copy_ctor(&c.value);
|
||||
c.flags = CONST_CS;
|
||||
c.name = zend_strndup("STDSCR", 7);
|
||||
c.name_len = 7;
|
||||
c.name = zend_strndup(ZEND_STRS("STDSCR"));
|
||||
c.name_len = sizeof("STDSCR");
|
||||
zend_register_constant(&c TSRMLS_CC);
|
||||
|
||||
/* we need this "interesting" arrangement because the
|
||||
@ -162,7 +162,7 @@ PHP_FUNCTION(ncurses_init)
|
||||
c.value = *zscr; \
|
||||
zval_copy_ctor(&c.value); \
|
||||
c.flags = CONST_CS; \
|
||||
c.name = zend_strndup("NCURSES_" #x, sizeof("NCURSES_" #x)); \
|
||||
c.name = zend_strndup(ZEND_STRS("NCURSES_" #x)); \
|
||||
c.name_len = sizeof("NCURSES_" #x); \
|
||||
zend_register_constant(&c TSRMLS_CC)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user