Modernize libc usage: stop using off_t, use modern printf.

C++ 14 is here, and old versions of MSVC and MSVCRT have
haunted us long enough.
This commit is contained in:
Markus F.X.J. Oberhumer
2021-01-05 18:52:05 +01:00
parent b4429e1a42
commit 700c8730cf
19 changed files with 130 additions and 1010 deletions
+3 -3
View File
@@ -223,7 +223,7 @@ int PackCom::canUnpack()
{
if (!readPackHeader(128))
return false;
if (file_size <= (off_t) ph.c_len)
if (file_size_u <= ph.c_len)
return false;
return true;
}
@@ -243,8 +243,8 @@ void PackCom::unpack(OutputFile *fo)
fi->readx(ibuf,file_size);
// get compressed data offset
int e_len = ph.buf_offset + ph.getPackHeaderSize();
if (file_size <= e_len + (off_t)ph.c_len)
unsigned e_len = ph.buf_offset + ph.getPackHeaderSize();
if (file_size_u <= e_len + ph.c_len)
throwCantUnpack("file damaged");
// decompress