Fixed crash bug
This commit is contained in:
parent
4f9f548a58
commit
0686da47a6
|
@ -149,6 +149,11 @@ static cell AMX_NATIVE_CALL socket_recv(AMX *amx, cell *params) /* 2 param */
|
||||||
memset(tmpchar, 0, length);
|
memset(tmpchar, 0, length);
|
||||||
// Now we recieve
|
// Now we recieve
|
||||||
tmp = recv(socket, tmpchar, length-1, 0);
|
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
|
// And put a copy of our recieved data into amx's string
|
||||||
tmpchar[tmp]='\0';
|
tmpchar[tmp]='\0';
|
||||||
int nlen = 0;
|
int nlen = 0;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user