From 185e6027e7a826b7233dea0c5d5f686f43388ed4 Mon Sep 17 00:00:00 2001 From: CPunch Date: Tue, 19 Jan 2021 22:56:52 -0600 Subject: [PATCH] whoops --- src/cbaselib.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cbaselib.c b/src/cbaselib.c index 262a103..65e02db 100644 --- a/src/cbaselib.c +++ b/src/cbaselib.c @@ -245,7 +245,7 @@ int cosmoB_sSplit(CState *state, int nargs, CValue *args) { nIndx = strstr(indx, ptrn->str); cosmoV_pushNumber(state, nEntries++); - cosmoV_pushLString(state, indx, nIndx == NULL ? (indx - str->str) - str->length : nIndx - indx); + cosmoV_pushLString(state, indx, nIndx == NULL ? str->length - (indx - str->str) : nIndx - indx); indx = nIndx + ptrn->length; } while (nIndx != NULL);