Skip to content

Commit

Permalink
Fix OpenTTD#9361, a2051ba: [Network] Off by one in CanWriteToPacket
Browse files Browse the repository at this point in the history
Previously it did not allow writing a byte to a packet that was of size limit - 1 anymore.
  • Loading branch information
rubidium42 committed Jun 13, 2021
1 parent 71f3c35 commit 0f03e64
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/network/core/packet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ void Packet::PrepareToSend()
*/
bool Packet::CanWriteToPacket(size_t bytes_to_write)
{
return this->Size() + bytes_to_write < this->limit;
return this->Size() + bytes_to_write <= this->limit;
}

/*
Expand Down

0 comments on commit 0f03e64

Please sign in to comment.