mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-06-26 00:23:55 -07:00
Lint.
Took 3 minutes
This commit is contained in:
parent
337b644d66
commit
de7bb7ddb9
4 changed files with 11 additions and 6 deletions
|
|
@ -59,15 +59,17 @@ void SingleInstanceManager::handleNewConnection()
|
|||
while (true) {
|
||||
// Step 1: read size
|
||||
if (*expectedSize == 0) {
|
||||
if (buffer->size() < static_cast<int>(sizeof(quint32)))
|
||||
if (buffer->size() < static_cast<int>(sizeof(quint32))) {
|
||||
return;
|
||||
}
|
||||
|
||||
stream >> *expectedSize;
|
||||
}
|
||||
|
||||
// Step 2: wait for full payload
|
||||
if (buffer->size() < static_cast<int>(sizeof(quint32) + *expectedSize))
|
||||
if (buffer->size() < static_cast<int>(sizeof(quint32) + *expectedSize)) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Step 3: extract payload
|
||||
QByteArray payload = buffer->mid(sizeof(quint32), *expectedSize);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue