add document as a memorandum

This commit is contained in:
2023-08-26 14:23:33 +08:00
parent 4a787610f1
commit 91a37b5b7e
4 changed files with 335 additions and 2 deletions

View File

@ -390,7 +390,7 @@ namespace LibCmo::CK2 {
if (this->m_Parser.m_Status != CKStateChunkStatus::READ) return false;
CKDWORD pos = 0u;
if (this->m_DataDwSize < 2) return false; // impossible to have a identifier
if (this->m_DataDwSize < 2u) return false; // impossible to have a identifier
// search identifier
while (this->m_pData[pos] != identifier) {
@ -409,7 +409,7 @@ namespace LibCmo::CK2 {
// the last identifier, use chunk size instead
nextptr = this->m_DataDwSize;
}
*out_size = sizeof(CKDWORD) * (nextptr - pos);
*out_size = sizeof(CKDWORD) * (nextptr - pos - 2u);
return true;
}