Changeset - r25652:89ab1173802a
[Not reviewed]
master
0 1 0
rubidium42 - 3 years ago 2021-06-13 08:07:44
rubidium@openttd.org
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.
1 file changed with 1 insertions and 1 deletions:
0 comments (0 inline, 0 general)
src/network/core/packet.cpp
Show inline comments
 
@@ -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;
 
}
 

	
 
/*
0 comments (0 inline, 0 general)