diff options
author | Wez Furlong <wez@php.net> | 2002-09-28 17:03:02 +0000 |
---|---|---|
committer | Wez Furlong <wez@php.net> | 2002-09-28 17:03:02 +0000 |
commit | 0b5aae65f12b9e85f83bb065d088b02255e95eec (patch) | |
tree | 69189652841e7a27aa0a5536fc88c3a8860c3b70 /ext/ncurses | |
parent | 5a239ab0593f74610a3a554df93dbad3204cef6d (diff) | |
download | php-git-0b5aae65f12b9e85f83bb065d088b02255e95eec.tar.gz |
Fix crash bug and return value.
Diffstat (limited to 'ext/ncurses')
-rw-r--r-- | ext/ncurses/ncurses_functions.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/ext/ncurses/ncurses_functions.c b/ext/ncurses/ncurses_functions.c index 073bcd8d96..ef4f4d9b95 100644 --- a/ext/ncurses/ncurses_functions.c +++ b/ext/ncurses/ncurses_functions.c @@ -1642,7 +1642,7 @@ PHP_FUNCTION(ncurses_longname) } /* }}} */ -/* {{{ proto int ncurses_mousemask(int newmask, int oldmask) +/* {{{ proto int ncurses_mousemask(int newmask, int &oldmask) Returns and sets mouse options */ PHP_FUNCTION(ncurses_mousemask) { @@ -1669,13 +1669,13 @@ PHP_FUNCTION(ncurses_mousemask) Reads mouse event from queue */ PHP_FUNCTION(ncurses_getmouse) { - zval **arg; + zval **arg; MEVENT mevent; ulong retval; if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &arg) == FAILURE){ WRONG_PARAM_COUNT; - } + } pval_destructor(*arg); array_init(*arg); @@ -1688,7 +1688,7 @@ PHP_FUNCTION(ncurses_getmouse) add_assoc_long(*arg, "z", mevent.z); add_assoc_long(*arg, "mmask", mevent.bstate); - RETURN_BOOL(retval); + RETURN_BOOL(retval == 0); } /* }}} */ @@ -1775,9 +1775,9 @@ PHP_FUNCTION(ncurses_wmouse_trafo) int nx, ny, retval; WINDOW **win; - if (ZEND_NUM_ARGS() != 4 || zend_get_parameters_ex(4, &y, &x, &toscreen) == FAILURE){ + if (ZEND_NUM_ARGS() != 4 || zend_get_parameters_ex(4, &handle, &y, &x, &toscreen) == FAILURE){ WRONG_PARAM_COUNT; - } + } FETCH_WINRES(win, handle); @@ -1788,10 +1788,10 @@ PHP_FUNCTION(ncurses_wmouse_trafo) ny = Z_LVAL_PP(y); nx = Z_LVAL_PP(x); - retval = wmouse_trafo (*win, &ny, &nx, Z_LVAL_PP(toscreen)); + retval = wmouse_trafo (*win, &ny, &nx, Z_LVAL_PP(toscreen)); - Z_LVAL_PP(y) = ny; - Z_LVAL_PP(x) = nx; + Z_LVAL_PP(y) = ny; + Z_LVAL_PP(x) = nx; RETURN_BOOL(retval); } |