mirror of
https://github.com/alliedmodders/amxmodx.git
synced 2024-12-26 06:45:37 +03:00
Add check for size > 0.
If size <= 0 error will be throwed.
This commit is contained in:
parent
a0d6570d31
commit
20d802368b
@ -4460,6 +4460,11 @@ static cell AMX_NATIVE_CALL arraycompare(AMX *amx, cell *params)
|
||||
cell *with = get_amxaddr(amx, params[2]);
|
||||
int size = params[3];
|
||||
|
||||
if(size < 1){
|
||||
LogError(amx, AMX_ERR_NATIVE, "Invalid size (%d).", size);
|
||||
return 0;
|
||||
}
|
||||
|
||||
while (size--)
|
||||
if (*with++ != *what++)
|
||||
return 0;
|
||||
|
@ -3316,7 +3316,8 @@ native arrayset(any:array[], any:value, size);
|
||||
* @param with Second array
|
||||
* @param size Size of array
|
||||
*
|
||||
* @return Returns true if arrays are equaly, false otherwise.
|
||||
* @return Returns true if arrays are equaly, false otherwise.
|
||||
* @error If size < 1.
|
||||
*/
|
||||
native bool:arraycompare(const any:what[], const any:with[], const size);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user