diff options
Diffstat (limited to 'ext/phar/phar_object.c')
-rw-r--r-- | ext/phar/phar_object.c | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/ext/phar/phar_object.c b/ext/phar/phar_object.c index 876d5da83d..625ed3c6c7 100644 --- a/ext/phar/phar_object.c +++ b/ext/phar/phar_object.c @@ -67,7 +67,7 @@ static void phar_mung_server_vars(char *fname, char *entry, int entry_len, char if (NULL != (stuff = zend_hash_str_find(_SERVER, "PATH_INFO", sizeof("PATH_INFO")-1))) { path_info = Z_STRVAL_P(stuff); code = Z_STRLEN_P(stuff); - if (code > entry_len && !memcmp(path_info, entry, entry_len)) { + if (code > (size_t)entry_len && !memcmp(path_info, entry, entry_len)) { ZVAL_STR(&temp, Z_STR_P(stuff)); ZVAL_STRINGL(stuff, path_info + entry_len, request_uri_len); zend_hash_str_update(_SERVER, "PHAR_PATH_INFO", sizeof("PHAR_PATH_INFO")-1, &temp); @@ -1129,7 +1129,7 @@ static void phar_spl_foreign_clone(spl_filesystem_object *src, spl_filesystem_ob } /* }}} */ -static spl_other_handler phar_spl_foreign_handler = { +static const spl_other_handler phar_spl_foreign_handler = { phar_spl_foreign_dtor, phar_spl_foreign_clone }; @@ -4164,7 +4164,7 @@ PHP_METHOD(Phar, delMetadata) } /* }}} */ -static int phar_extract_file(zend_bool overwrite, phar_entry_info *entry, char *dest, int dest_len, char **error) /* {{{ */ +static int phar_extract_file(zend_bool overwrite, phar_entry_info *entry, char *dest, size_t dest_len, char **error) /* {{{ */ { php_stream_statbuf ssb; size_t len; @@ -4206,13 +4206,13 @@ static int phar_extract_file(zend_bool overwrite, phar_entry_info *entry, char * #ifdef PHP_WIN32 /* unixify the path back, otherwise non zip formats might be broken */ { - int cnt = filename_len; + size_t cnt = 0; do { if ('\\' == filename[cnt]) { filename[cnt] = '/'; } - } while (cnt-- >= 0); + } while (cnt++ <= filename_len); } #endif @@ -4433,7 +4433,7 @@ PHP_METHOD(Phar, extractTo) zend_throw_exception_ex(phar_ce_PharException, 0, "Phar Error: attempted to extract non-existent file \"%s\" from phar \"%s\"", Z_STRVAL_P(zval_file), phar_obj->archive->fname); } - if (FAILURE == phar_extract_file(overwrite, entry, pathto, (int)pathto_len, &error)) { + if (FAILURE == phar_extract_file(overwrite, entry, pathto, pathto_len, &error)) { zend_throw_exception_ex(phar_ce_PharException, 0, "Extraction from phar \"%s\" failed: %s", phar_obj->archive->fname, error); efree(error); @@ -4454,7 +4454,7 @@ PHP_METHOD(Phar, extractTo) return; } - if (FAILURE == phar_extract_file(overwrite, entry, pathto, (int)pathto_len, &error)) { + if (FAILURE == phar_extract_file(overwrite, entry, pathto, pathto_len, &error)) { zend_throw_exception_ex(phar_ce_PharException, 0, "Extraction from phar \"%s\" failed: %s", phar_obj->archive->fname, error); efree(error); @@ -4470,7 +4470,7 @@ all_files: } ZEND_HASH_FOREACH_PTR(&phar->manifest, entry) { - if (FAILURE == phar_extract_file(overwrite, entry, pathto, (int)pathto_len, &error)) { + if (FAILURE == phar_extract_file(overwrite, entry, pathto, pathto_len, &error)) { zend_throw_exception_ex(phar_ce_PharException, 0, "Extraction from phar \"%s\" failed: %s", phar->fname, error); efree(error); @@ -5296,7 +5296,7 @@ ZEND_BEGIN_ARG_INFO(arginfo_phar__void, 0) ZEND_END_ARG_INFO() -zend_function_entry php_archive_methods[] = { +static const zend_function_entry php_archive_methods[] = { PHP_ME(Phar, __construct, arginfo_phar___construct, ZEND_ACC_PUBLIC) PHP_ME(Phar, __destruct, arginfo_phar__void, ZEND_ACC_PUBLIC) PHP_ME(Phar, addEmptyDir, arginfo_phar_emptydir, ZEND_ACC_PUBLIC) @@ -5365,7 +5365,7 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_data___construct, 0, 0, 1) ZEND_ARG_INFO(0, fileformat) ZEND_END_ARG_INFO() -zend_function_entry php_data_methods[] = { +static const zend_function_entry php_data_methods[] = { PHP_ME(Phar, __construct, arginfo_data___construct, ZEND_ACC_PUBLIC) PHP_ME(Phar, __destruct, arginfo_phar__void, ZEND_ACC_PUBLIC) PHP_ME(Phar, addEmptyDir, arginfo_phar_emptydir, ZEND_ACC_PUBLIC) @@ -5434,7 +5434,7 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_entry_chmod, 0, 0, 1) ZEND_ARG_INFO(0, perms) ZEND_END_ARG_INFO() -zend_function_entry php_entry_methods[] = { +static const zend_function_entry php_entry_methods[] = { PHP_ME(PharFileInfo, __construct, arginfo_entry___construct, ZEND_ACC_PUBLIC) PHP_ME(PharFileInfo, __destruct, arginfo_phar__void, ZEND_ACC_PUBLIC) PHP_ME(PharFileInfo, chmod, arginfo_entry_chmod, ZEND_ACC_PUBLIC) @@ -5453,7 +5453,7 @@ zend_function_entry php_entry_methods[] = { PHP_FE_END }; -zend_function_entry phar_exception_methods[] = { +static const zend_function_entry phar_exception_methods[] = { PHP_FE_END }; /* }}} */ |