hated the styling of this

consistency is nice to have
This commit is contained in:
2023-11-03 22:36:59 -05:00
parent 1a7d6caec6
commit 7a54230cb9
7 changed files with 35 additions and 19 deletions

View File

@@ -699,8 +699,9 @@ int cosmoB_sRep(CState *state, int nargs, CValue *args)
char *newStr = cosmoM_xmalloc(state, length + 1); // + 1 for the NULL terminator
// copy the string over the new buffer
for (int i = 0; i < times; i++)
for (int i = 0; i < times; i++) {
memcpy(&newStr[i * str->length], str->str, str->length);
}
// write the NULL terminator
newStr[length] = '\0';