fix tiny bug

This commit is contained in:
2026-04-13 18:48:54 +10:00
parent 90c91f7c4c
commit 1c752c03db

View File

@@ -68,7 +68,7 @@ GroundValue stringSubstring(GroundScope* scope, List args) {
if (start >= inputLen)
ERROR("Start is outside string!", "OutOfBounds");
else if (end >= inputLen)
else if (end >= inputLen || end < 0)
ERROR("End is outside string!", "OutOfBounds");
char* buffer = malloc(inputLen + 1);