summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorrubidium42 <rubidium@openttd.org>2021-06-13 10:07:44 +0200
committerrubidium42 <rubidium42@users.noreply.github.com>2021-06-13 10:31:02 +0200
commit845fded2a08a62fa2afd8a041d168c6774f113df (patch)
tree46402e3288e3771d815fc512348c3b5dd8fba70c /src
parentbf500c39c9b6c7359204c5454aefa0dc7f51dae5 (diff)
downloadopenttd-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')
-rw-r--r--src/network/core/packet.cpp2
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;
}
/*