diff --git a/src/p_djgpp2.cpp b/src/p_djgpp2.cpp index 85684214..2234b7b2 100644 --- a/src/p_djgpp2.cpp +++ b/src/p_djgpp2.cpp @@ -138,16 +138,16 @@ void PackDjgpp2::handleStub(OutputFile *fo) } -static bool is_dlm(InputFile *fi, long coff_offset) +static bool is_dlm(InputFile *fi, unsigned coff_offset) { unsigned char buf[4]; - long off; + unsigned off; try { fi->seek(coff_offset, SEEK_SET); fi->readx(buf, 4); off = get_le32(buf); - if (off < 0 || off > coff_offset + 4) + if (off > coff_offset + 4) return false; fi->seek(off, SEEK_SET); fi->readx(buf, 4); diff --git a/src/p_djgpp2.h b/src/p_djgpp2.h index ac044d42..9edfca48 100644 --- a/src/p_djgpp2.h +++ b/src/p_djgpp2.h @@ -64,7 +64,7 @@ protected: virtual void buildLoader(const Filter *ft); virtual Linker* newLinker() const; - long coff_offset; + unsigned coff_offset; __packed_struct(external_scnhdr_t) char _[12]; // name, paddr