This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// fork from https://github.com/irl/la-cucina/blob/master/str_replace.c | |
char* str_replace(char* string, const char* substr, const char* replacement) { | |
char* tok = NULL; | |
char* newstr = NULL; | |
char* oldstr = NULL; | |
int oldstr_len = 0; | |
int substr_len = 0; | |
int replacement_len = 0; | |
newstr = strdup(string); |