merge l_net from ZeroRadiant
authordivverent <divverent@61c419a2-8eb2-4b30-bcec-8cead039b335>
Mon, 4 Jan 2010 10:39:05 +0000 (10:39 +0000)
committerdivverent <divverent@61c419a2-8eb2-4b30-bcec-8cead039b335>
Mon, 4 Jan 2010 10:39:05 +0000 (10:39 +0000)
git-svn-id: svn://svn.icculus.org/netradiant/trunk@409 61c419a2-8eb2-4b30-bcec-8cead039b335

libs/l_net/l_net.c

index 558ec211944083a1165921a705cb3f01516f9a00..878e6a47ade6bfeb63bf25d437934954090b6354 100644 (file)
@@ -480,7 +480,7 @@ void NMSG_WriteString(netmessage_t *msg, char *string)
                WinPrint("NMSG_WriteString: overflow\n");
                return;
        } //end if
-       strcpy(&msg->data[msg->size], string);
+       memcpy(&msg->data[msg->size], string, strlen(string) + 1);
        msg->size += strlen(string) + 1;
 } //end of the function NMSG_WriteString
 //===========================================================================
@@ -502,7 +502,7 @@ void NMSG_ReadStart(netmessage_t *msg)
 //===========================================================================
 int NMSG_ReadChar(netmessage_t *msg)
 {
-       if (msg->size + 1 > msg->size)
+       if (msg->read + 1 > msg->size)
        {
                msg->readoverflow = qtrue;
                WinPrint("NMSG_ReadChar: read overflow\n");