mirror of
https://github.com/CPunch/Cosmo.git
synced 2025-12-23 19:00:04 +00:00
hated the styling of this
consistency is nice to have
This commit is contained in:
@@ -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';
|
||||
|
||||
Reference in New Issue
Block a user