diff --git a/libs/string/string.c b/libs/string/string.c index f2fab4b..2feca4c 100644 --- a/libs/string/string.c +++ b/libs/string/string.c @@ -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);