1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 08:12:21 +01:00

ext/phar: Mark constant string as static const

This commit is contained in:
Gina Peter Bnayard
2024-09-13 13:30:10 +02:00
committed by Gina Peter Banyard
parent 3f1a4441bd
commit 290fb920f2
3 changed files with 6 additions and 4 deletions

View File

@@ -2531,7 +2531,8 @@ int phar_flush(phar_archive_data *phar, char **error) {
*/
int phar_flush_ex(phar_archive_data *phar, zend_string *user_stub, bool is_default_stub, char **error) /* {{{ */
{
char halt_stub[] = "__HALT_COMPILER();";
static const char halt_stub[] = "__HALT_COMPILER();";
zend_string *newstub;
phar_entry_info *entry, *newentry;
size_t halt_offset;

View File

@@ -957,14 +957,15 @@ static int phar_tar_setupmetadata(zval *zv, void *argument) /* {{{ */
int phar_tar_flush(phar_archive_data *phar, zend_string *user_stub, bool is_default_stub, char **error) /* {{{ */
{
phar_entry_info entry = {0};
static const char newstub[] = "<?php // tar-based phar archive stub file\n__HALT_COMPILER();";
static const char halt_stub[] = "__HALT_COMPILER();";
phar_entry_info entry = {0};
php_stream *oldfile, *newfile;
bool must_close_old_file = false;
size_t signature_length;
struct _phar_pass_tar_info pass;
char *buf, *signature, sigbuf[8];
char halt_stub[] = "__HALT_COMPILER();";
entry.flags = PHAR_ENT_PERM_DEF_FILE;
entry.timestamp = time(NULL);

View File

@@ -1254,7 +1254,7 @@ static int phar_zip_applysignature(phar_archive_data *phar, struct _phar_zip_pas
int phar_zip_flush(phar_archive_data *phar, zend_string *user_stub, bool is_default_stub, char **error) /* {{{ */
{
static const char newstub[] = "<?php // zip-based phar archive stub file\n__HALT_COMPILER();";
char halt_stub[] = "__HALT_COMPILER();";
static const char halt_stub[] = "__HALT_COMPILER();";
php_stream *oldfile;
bool must_close_old_file = false;