some basic changes to try to fix for the -Wpedantic flag

This commit is contained in:
herbglitch 2024-06-16 02:49:23 -06:00
parent 19d6120871
commit 3f5e631388
4 changed files with 31 additions and 4 deletions

View file

@ -69,6 +69,22 @@ void ARC_String_CopySubstring(ARC_String **substring, ARC_String *original, uint
ARC_String_Create(substring, data, length);
}
void ARC_String_ReplaceWithSubstring(ARC_String **string, uint64_t start, uint64_t length){
ARC_String *substring;
ARC_String_CopySubstring(&substring, *string, start, length);
//if error or substring is null free memory and return
if(arc_errno || substring == NULL){
if(substring != NULL){
free(substring);
}
return;
}
free(*string);
*string = substring;
}
void ARC_String_RemoveSubstring(ARC_String **newString, ARC_String *original, ARC_String *substring){
uint64_t index = ARC_String_Find(original, substring);
if(arc_errno){