Fix sockets crash (#418)

This commit is contained in:
Karol Szuster 2017-03-04 14:14:08 +01:00 committed by Vincent Herbet
parent 6a553122b1
commit b7773ba11f

View File

@ -203,9 +203,10 @@ static cell AMX_NATIVE_CALL socket_recv(AMX *amx, cell *params)
int current_length = 0;
int max_length = length - 1;
const char *buffer = recv_buffer;
while(max_length-- && current_length < bytes_received)
{
*destination++ = (cell)*recv_buffer++;
*destination++ = (cell)*buffer++;
current_length++;
}