diff options
author | Wez Furlong <wez@php.net> | 2004-12-23 19:39:22 +0000 |
---|---|---|
committer | Wez Furlong <wez@php.net> | 2004-12-23 19:39:22 +0000 |
commit | e1f3beaa137d604daa4ece6e5843900a5cdb62eb (patch) | |
tree | 6fdc3df9d09db4e12995340c7a724156dffcd74c /ext/standard | |
parent | d0f606f11d2c1a2ebb96cbc4e293b663328e31d4 (diff) | |
download | php-git-e1f3beaa137d604daa4ece6e5843900a5cdb62eb.tar.gz |
really don't blow up
Diffstat (limited to 'ext/standard')
-rw-r--r-- | ext/standard/streamsfuncs.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/ext/standard/streamsfuncs.c b/ext/standard/streamsfuncs.c index 20052146b5..7ee44a0752 100644 --- a/ext/standard/streamsfuncs.c +++ b/ext/standard/streamsfuncs.c @@ -250,7 +250,7 @@ PHP_FUNCTION(stream_socket_accept) if (peername) { zval_dtor(peername); - ZVAL_STRING(peername, "", 0); + ZVAL_NULL(peername); } if (0 == php_stream_xport_accept(stream, &clistream, @@ -260,6 +260,7 @@ PHP_FUNCTION(stream_socket_accept) &tv, &errstr TSRMLS_CC) && clistream) { + Z_TYPE_P(peername) = IS_STRING; php_stream_to_zval(clistream, return_value); } else { php_error_docref(NULL TSRMLS_CC, E_WARNING, "accept failed: %s", errstr ? errstr : "Unknown error"); @@ -270,10 +271,6 @@ PHP_FUNCTION(stream_socket_accept) if (errstr) { efree(errstr); } - - if (peername && Z_STRVAL_P(peername) == NULL) { - ZVAL_STRING(peername, "", 1); - } } /* }}} */ |