Skip to content

Commit 0155b50

Browse files
committed
phar: Fix const-generic compile warnings
1 parent d81db0b commit 0155b50

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

ext/phar/phar_object.c

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,8 @@ static zend_class_entry *phar_ce_entry;
4646

4747
static int phar_file_type(const HashTable *mimes, const char *file, char **mime_type) /* {{{ */
4848
{
49-
char *ext;
5049
phar_mime_type *mime;
51-
ext = strrchr(file, '.');
50+
const char *ext = strrchr(file, '.');
5251
if (!ext) {
5352
*mime_type = "text/plain";
5453
/* 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,
347346
/* post-process REQUEST_URI and retrieve the actual request URI. This is for
348347
cases like http://localhost/blah.phar/path/to/file.php/extra/stuff
349348
which calls "blah.phar" file "path/to/file.php" with PATH_INFO "/extra/stuff" */
350-
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) /* {{{ */
349+
static void phar_postprocess_ru_web(char *fname, size_t fname_len, char *entry, size_t *entry_len, char **ru, size_t *ru_len) /* {{{ */
351350
{
352-
const char *e = entry + 1;
353-
char *u = NULL, *u1 = NULL, *saveu = NULL;
351+
char *e = entry + 1, *u1 = NULL, *u = NULL, *saveu = NULL;
354352
size_t e_len = *entry_len - 1, u_len = 0;
355353
phar_archive_data *pphar;
356354

ext/phar/tar.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,8 @@ bool phar_is_tar(const char *buf, const char *fname) /* {{{ */
105105
tar_header *header = (tar_header *) buf;
106106
uint32_t checksum = phar_tar_number(header->checksum, sizeof(header->checksum));
107107
bool is_tar;
108-
char save[sizeof(header->checksum)], *bname;
108+
char save[sizeof(header->checksum)];
109+
const char *bname;
109110

110111
/* assume that the first filename in a tar won't begin with <?php */
111112
if (!strncmp(buf, "<?php", sizeof("<?php")-1)) {

0 commit comments

Comments
 (0)