summaryrefslogtreecommitdiffstats
path: root/extended.cc
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2019-04-13 08:59:14 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2019-04-13 08:59:14 +0000
commitbab86e3bc6fcc2b148d2a58247e27c765b2b1471 (patch)
treea21a640ddd20d20c6d01cfe1f13b5494722fcb1c /extended.cc
parentReleasing debian version 0.14-1. (diff)
downloadtarlz-bab86e3bc6fcc2b148d2a58247e27c765b2b1471.tar.xz
tarlz-bab86e3bc6fcc2b148d2a58247e27c765b2b1471.zip
Merging upstream version 0.15.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'extended.cc')
-rw-r--r--extended.cc8
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 )