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
+1 -1
View File
@@ -2094,7 +2094,7 @@ void PeFile::readSectionHeaders(unsigned objs, unsigned sizeof_ih)
}
mb_isection.alloc(sizeof(pe_section_t) * objs);
isection = (pe_section_t *)mb_isection.getVoidPtr();
if (file_size < (off_t)(pe_offset + sizeof_ih + sizeof(pe_section_t)*objs)) {
if (file_size_u < pe_offset + sizeof_ih + sizeof(pe_section_t)*objs) {
char buf[32]; snprintf(buf, sizeof(buf), "too many sections %d", objs);
throwCantPack(buf);
}