[utils] string_replace_char does single byte/character replacement, new string_replace to do full string replacement, again using char_array for safety, string_replace_with_array function for memory reuse

This commit is contained in:
Al
2017-02-17 13:58:51 -05:00
parent da856ea5c3
commit b88487f633
3 changed files with 51 additions and 4 deletions

View File

@@ -64,7 +64,7 @@ char *normalize_string_utf8(char *str, uint64_t options) {
}
if (options & NORMALIZE_STRING_REPLACE_HYPHENS && strchr(str, '-') != NULL) {
char *replaced = string_replace(str, '-', ' ');
char *replaced = string_replace_char(str, '-', ' ');
if (replaced != NULL) {
if (normalized_allocated) {
free(normalized);