Skip to content

Commit

Permalink
Do not warn about primitives of size 0.
Browse files Browse the repository at this point in the history
Otherwise this shows a warning for every RPG Maker 2003 English database which contains a 0-byte version field.

This issue always existed but was hidden behind LCF_DEBUG_TRACE.
  • Loading branch information
Ghabry committed Aug 25, 2024
1 parent d8c4cc8 commit c653891
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/reader_struct.h
Original file line number Diff line number Diff line change
Expand Up @@ -268,12 +268,12 @@ struct Primitive<int32_t> {
#ifdef LCF_DEBUG_TRACE
fprintf(stderr, " %d\n", ref);
#endif
} else {
} else if (length == 0) {
ref = 0;
} else {
Log::Warning("Invalid integer at %X", stream.Tell());
stream.Seek(length, LcfReader::FromCurrent);
}

}
static void WriteLcf(const int32_t& ref, LcfWriter& stream) {
stream.WriteInt(ref);
Expand Down

0 comments on commit c653891

Please sign in to comment.