diff options
Diffstat (limited to 'src/util.c')
-rw-r--r-- | src/util.c | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -251,15 +251,15 @@ next: /** * Replaces appearances of search in string by given replace. - * Returne a new allocated string of search was found. + * Returne a new allocated string if search was found. */ -char *util_str_replace(const char* search, const char* replace, const char* string) +char *util_str_replace(const char* search, const char* replace, const char* string, int max_replaces) { if (!string) { return NULL; } - char **buf = g_strsplit(string, search, -1); + char **buf = g_strsplit(string, search, max_replaces + 1); char *ret = g_strjoinv(replace, buf); g_strfreev(buf); |