Skip to content

Commit 12f9de4

Browse files
committed
n_strval: Add missing len check or it will assert (possibly accidentally removed between commits from the vendor repository?) older amx versions have this check.
1 parent ea50010 commit 12f9de4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

amx-deps/src/amx/amxstring.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -577,7 +577,7 @@ static cell AMX_NATIVE_CALL n_strval(AMX *amx,const cell *params)
577577
offset=params[2];
578578
if (offset<0)
579579
offset=0;
580-
else if (offset>=len)
580+
else if (offset>=len && len>0)
581581
offset=len-1;
582582

583583
/* skip a number of cells */

0 commit comments

Comments
 (0)