diff options
| author | Dmitry Stogov <dmitry@zend.com> | 2015-03-04 02:05:28 +0300 |
|---|---|---|
| committer | Dmitry Stogov <dmitry@zend.com> | 2015-03-04 02:05:28 +0300 |
| commit | 2fa8d67a5ce59ba9ba6192481e3c2522c3ff5542 (patch) | |
| tree | 9d9d57215f756c387722e74d7d1e1c2de3276a1c /ext/zip/zip_stream.c | |
| parent | 2841aa95db84f3563c94c90f84bf7f47ba159a2d (diff) | |
| download | php-git-2fa8d67a5ce59ba9ba6192481e3c2522c3ff5542.tar.gz | |
Use zend_string* instead of char* for opened_patch handling. Avoid reallocations and improve string reuse.
Diffstat (limited to 'ext/zip/zip_stream.c')
| -rw-r--r-- | ext/zip/zip_stream.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/ext/zip/zip_stream.c b/ext/zip/zip_stream.c index d56213d1d5..18707eed27 100644 --- a/ext/zip/zip_stream.c +++ b/ext/zip/zip_stream.c @@ -254,7 +254,7 @@ php_stream *php_stream_zip_opener(php_stream_wrapper *wrapper, const char *path, const char *mode, int options, - char **opened_path, + zend_string **opened_path, php_stream_context *context STREAMS_DC) { int path_len; @@ -314,7 +314,7 @@ php_stream *php_stream_zip_opener(php_stream_wrapper *wrapper, stream = php_stream_alloc(&php_stream_zipio_ops, self, NULL, mode); if (opened_path) { - *opened_path = estrdup(path); + *opened_path = zend_string_init(path, strlen(path), 0); } } else { zip_close(za); |
