diff options
Diffstat (limited to 'extended.cc')
-rw-r--r-- | extended.cc | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/extended.cc b/extended.cc index 39b0f5a..0e647c6 100644 --- a/extended.cc +++ b/extended.cc @@ -64,7 +64,7 @@ unsigned long long parse_decimal( const char * const ptr, { const unsigned long long prev = result; result *= 10; result += ptr[i] - '0'; - if( result < prev || result > LLONG_MAX ) // overflow + if( result < prev || result > max_file_size ) // overflow { if( tailp ) *tailp = ptr; return 0; } } if( tailp ) *tailp = ptr + i; @@ -219,7 +219,7 @@ bool Extended::parse( const char * const buf, const unsigned long long edsize, if( file_size_ != 0 && !permissive ) return false; file_size_ = parse_decimal( tail + 5, &tail, rest - 5 ); // parse error or size fits in ustar header - if( file_size_ < 1ULL << 33 || tail != buf + ( pos + rsize - 1 ) ) + if( file_size_ < 1LL << 33 || tail != buf + ( pos + rsize - 1 ) ) return false; } else if( rest > 10 && std::memcmp( tail, "GNU.crc32=", 10 ) == 0 ) @@ -281,9 +281,9 @@ void Extended::fill_from_ustar( const Tar_header header ) /* Returns file size from record or from ustar header, and resets file_size_. Used for fast parsing of headers in uncompressed archives. */ -unsigned long long Extended::get_file_size_and_reset( const Tar_header header ) +long long Extended::get_file_size_and_reset( const Tar_header header ) { - const unsigned long long tmp = file_size_; + const long long tmp = file_size_; file_size( 0 ); const Typeflag typeflag = (Typeflag)header[typeflag_o]; if( typeflag == tf_regular || typeflag == tf_hiperf ) |