]> granicus.if.org Git - php/commitdiff
Fixed extra byte allocation in constant creation code.
authorIlia Alshanetsky <iliaa@php.net>
Fri, 12 Dec 2003 00:23:15 +0000 (00:23 +0000)
committerIlia Alshanetsky <iliaa@php.net>
Fri, 12 Dec 2003 00:23:15 +0000 (00:23 +0000)
ext/ncurses/ncurses_functions.c

index 1bdd3de23ab6c662a1a39b02e1956ba092dea97a..cd0d716dbc9a4c8fb9305d5229014506849632b5 100644 (file)
@@ -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)