On 17.01.2008 23:33, Michael B Allen wrote:
> This has worked fine
Are you really sure?
Does valgrind confirm it?
> PHP_FUNCTION(foo_status)
> {
> zval *r;
> char *s = "";
> int slen;
> struct foo *foo = NULL;
>
> if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z!|s!",
> &r, &s, &slen) == FAILURE) {
> RETURN_FALSE;
> }
>
> if (r)
> foo = (struct foo *)zend_fetch_resource(&r TSRMLS_CC,
> -1, "foo", NULL, 1, le_foo);
>
> if (ZEND_NUM_ARGS() > 1) {
> foo_status(foo) = s; // save the status for possible retrieval later
> }
I don't know what "foo_status(foo)" is supposed to mean here,
but this code was never supposed to work.
You have to copy the string if you want to store it.
--
Wbr,
Antony Dovgal
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php