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

phar: Fix const-generic compile warnings

This commit is contained in:
ndossche
2026-03-09 20:45:07 +01:00
parent d81db0b9de
commit 0155b50984
2 changed files with 5 additions and 6 deletions

View File

@@ -46,9 +46,8 @@ static zend_class_entry *phar_ce_entry;
static int phar_file_type(const HashTable *mimes, const char *file, char **mime_type) /* {{{ */
{
char *ext;
phar_mime_type *mime;
ext = strrchr(file, '.');
const char *ext = strrchr(file, '.');
if (!ext) {
*mime_type = "text/plain";
/* no file extension = assume text/plain */
@@ -347,10 +346,9 @@ static void phar_do_404(phar_archive_data *phar, char *fname, size_t fname_len,
/* post-process REQUEST_URI and retrieve the actual request URI. This is for
cases like http://localhost/blah.phar/path/to/file.php/extra/stuff
which calls "blah.phar" file "path/to/file.php" with PATH_INFO "/extra/stuff" */
static void phar_postprocess_ru_web(const char *fname, size_t fname_len, const char *entry, size_t *entry_len, char **ru, size_t *ru_len) /* {{{ */
static void phar_postprocess_ru_web(char *fname, size_t fname_len, char *entry, size_t *entry_len, char **ru, size_t *ru_len) /* {{{ */
{
const char *e = entry + 1;
char *u = NULL, *u1 = NULL, *saveu = NULL;
char *e = entry + 1, *u1 = NULL, *u = NULL, *saveu = NULL;
size_t e_len = *entry_len - 1, u_len = 0;
phar_archive_data *pphar;

View File

@@ -105,7 +105,8 @@ bool phar_is_tar(const char *buf, const char *fname) /* {{{ */
tar_header *header = (tar_header *) buf;
uint32_t checksum = phar_tar_number(header->checksum, sizeof(header->checksum));
bool is_tar;
char save[sizeof(header->checksum)], *bname;
char save[sizeof(header->checksum)];
const char *bname;
/* assume that the first filename in a tar won't begin with <?php */
if (!strncmp(buf, "<?php", sizeof("<?php")-1)) {