PIDeque fix ssize_t

fix uninitialized variables
fix PIDeque prepend with std::initializer_list
This commit is contained in:
Бычков Андрей
2022-07-22 16:31:40 +03:00
parent f5953a0ba7
commit 0116387fe3
6 changed files with 45 additions and 44 deletions

View File

@@ -563,6 +563,8 @@ void PIBinaryLog::parseLog(PIFile * f, PIBinaryLog::BinLogInfo * info, PIVector<
if (!ok) return;
PIByteArray ba;
BinLogRecord br;
br.id = 0;
br.size = 0;
bool first = true;
size_t hdr_size = sizeof(BinLogRecord) - sizeof(PIByteArray);
ba.resize(hdr_size);
@@ -571,12 +573,9 @@ void PIBinaryLog::parseLog(PIFile * f, PIBinaryLog::BinLogInfo * info, PIVector<
{
if (f->read(ba.data(), ba.size()) > 0) {
ba >> br.id >> br.size >> br.timestamp;
} else
break;
if (info->log_size - f->pos() >= br.size)
f->seek(f->pos() + br.size);
else
break;
} else break;
if (info->log_size - f->pos() >= br.size) f->seek(f->pos() + br.size);
else break;
}
if (br.id > 0) {
if (info) {