mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 01:58:19 +00:00
Remove dead code
The condition `Size < 1` is never true because the previous condition `Size < NET_PACKETHEADERSIZE` (`Size < 3`) already covers it.
This commit is contained in:
parent
3c6402830d
commit
4970a615d8
|
@ -197,10 +197,7 @@ int CNetBase::UnpackPacket(unsigned char *pBuffer, int Size, CNetPacketConstruct
|
|||
{
|
||||
// check the size
|
||||
if(Size < NET_PACKETHEADERSIZE || Size > NET_MAX_PACKETSIZE)
|
||||
{
|
||||
//dbg_msg("", "packet too small, %d", Size);
|
||||
return -1;
|
||||
}
|
||||
|
||||
// log the data
|
||||
if(ms_DataLogRecv)
|
||||
|
@ -217,9 +214,6 @@ int CNetBase::UnpackPacket(unsigned char *pBuffer, int Size, CNetPacketConstruct
|
|||
|
||||
if(pPacket->m_Flags & NET_PACKETFLAG_CONNLESS)
|
||||
{
|
||||
if(Size < 1)
|
||||
return -1;
|
||||
|
||||
Sixup = (pBuffer[0] & 0x3) == 1;
|
||||
int Offset = Sixup ? 9 : 6;
|
||||
if(Size < Offset)
|
||||
|
|
Loading…
Reference in a new issue