Fixed crash bug

This commit is contained in:
David Anderson 2005-08-02 08:39:17 +00:00
parent 4f9f548a58
commit 0686da47a6

View File

@ -149,6 +149,11 @@ static cell AMX_NATIVE_CALL socket_recv(AMX *amx, cell *params) /* 2 param */
memset(tmpchar, 0, length);
// Now we recieve
tmp = recv(socket, tmpchar, length-1, 0);
if (tmp == SOCKET_ERROR)
{
delete [] tmpchar;
return SOCKET_ERROR;
}
// And put a copy of our recieved data into amx's string
tmpchar[tmp]='\0';
int nlen = 0;