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:
Robert Müller 2022-07-17 20:34:29 +02:00
parent 3c6402830d
commit 4970a615d8

View file

@ -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)