diff options
author | rubidium42 <rubidium@openttd.org> | 2021-06-13 10:07:44 +0200 |
---|---|---|
committer | rubidium42 <rubidium42@users.noreply.github.com> | 2021-06-13 10:31:02 +0200 |
commit | 845fded2a08a62fa2afd8a041d168c6774f113df (patch) | |
tree | 46402e3288e3771d815fc512348c3b5dd8fba70c /src/network | |
parent | bf500c39c9b6c7359204c5454aefa0dc7f51dae5 (diff) | |
download | openttd-845fded2a08a62fa2afd8a041d168c6774f113df.tar.xz |
Fix #9361, a2051ba: [Network] Off by one in CanWriteToPacket
Previously it did not allow writing a byte to a packet that was of size limit - 1 anymore.
Diffstat (limited to 'src/network')
-rw-r--r-- | src/network/core/packet.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/network/core/packet.cpp b/src/network/core/packet.cpp index 737b4624c..e106d5787 100644 --- a/src/network/core/packet.cpp +++ b/src/network/core/packet.cpp @@ -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; } /* |