Skip to content

Commit 66e824a

Browse files
committed
Rename phar number parser to avoid confusion
1 parent 9999d66 commit 66e824a

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

ext/phar/tar.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
#include "phar_internal.h"
2121
#include "ext/standard/php_string.h" /* For php_stristr() */
2222

23-
static uint32_t phar_tar_number(const char *buf, size_t len) /* {{{ */
23+
static uint32_t phar_tar_oct_number(const char *buf, size_t len) /* {{{ */
2424
{
2525
uint32_t num = 0;
2626
size_t i = 0;
@@ -103,7 +103,7 @@ static uint32_t phar_tar_checksum(char *buf, size_t len) /* {{{ */
103103
bool phar_is_tar(char *buf, char *fname) /* {{{ */
104104
{
105105
tar_header *header = (tar_header *) buf;
106-
uint32_t checksum = phar_tar_number(header->checksum, sizeof(header->checksum));
106+
uint32_t checksum = phar_tar_oct_number(header->checksum, sizeof(header->checksum));
107107
bool is_tar;
108108
char save[sizeof(header->checksum)], *bname;
109109

@@ -255,7 +255,7 @@ zend_result phar_parse_tarfile(php_stream* fp, char *fname, size_t fname_len, ch
255255

256256
pos = php_stream_tell(fp);
257257
hdr = (tar_header*) buf;
258-
sum1 = phar_tar_number(hdr->checksum, sizeof(hdr->checksum));
258+
sum1 = phar_tar_oct_number(hdr->checksum, sizeof(hdr->checksum));
259259
if (sum1 == 0 && phar_tar_checksum(buf, sizeof(buf)) == 0) {
260260
break;
261261
}
@@ -347,7 +347,7 @@ zend_result phar_parse_tarfile(php_stream* fp, char *fname, size_t fname_len, ch
347347
}
348348

349349
hdr = (tar_header*) buf;
350-
sum1 = phar_tar_number(hdr->checksum, sizeof(hdr->checksum));
350+
sum1 = phar_tar_oct_number(hdr->checksum, sizeof(hdr->checksum));
351351

352352
if (sum1 == 0 && phar_tar_checksum(buf, sizeof(buf)) == 0) {
353353
break;
@@ -479,12 +479,12 @@ zend_result phar_parse_tarfile(php_stream* fp, char *fname, size_t fname_len, ch
479479
return FAILURE;
480480
}
481481

482-
uint32_t entry_mode = phar_tar_number(hdr->mode, sizeof(hdr->mode));
482+
uint32_t entry_mode = phar_tar_oct_number(hdr->mode, sizeof(hdr->mode));
483483
entry.tar_type = ((old & (hdr->typeflag == '\0')) ? TAR_FILE : hdr->typeflag);
484484
entry.offset = entry.offset_abs = pos; /* header_offset unused in tar */
485485
entry.fp_type = PHAR_FP;
486486
entry.flags = entry_mode & PHAR_ENT_PERM_MASK;
487-
entry.timestamp = phar_tar_number(hdr->mtime, sizeof(hdr->mtime));
487+
entry.timestamp = phar_tar_oct_number(hdr->mtime, sizeof(hdr->mtime));
488488
entry.is_persistent = myphar->is_persistent;
489489

490490
if (old && entry.tar_type == TAR_FILE && S_ISDIR(entry_mode)) {

0 commit comments

Comments
 (0)