fix(iidxhook-util/settings): Bugfix broken paths with mixed / and \

Applies to iidx18 and iidx19 when using the recently extended
redirect feature for settings paths, mixing / and \ crashes the
game in some operator sub-menus when trying to save settings.
This commit is contained in:
icex2
2023-04-06 15:39:53 +02:00
committed by icex2
parent a2ceb0f6cc
commit 4d9fe0002a
3 changed files with 30 additions and 6 deletions
+11
View File
@@ -194,6 +194,17 @@ wchar_t *str_widen(const char *src)
return result;
}
void str_replace(char *str, char cur, char new)
{
while (*str != '\0') {
if (*str == cur) {
*str = new;
}
str++;
}
}
wchar_t *wstr_dup(const wchar_t *wstr)
{
wchar_t *dest;
+1
View File
@@ -15,6 +15,7 @@ size_t str_format(char *buf, size_t nchars, const char *fmt, ...);
void str_trim(char *str);
size_t str_vformat(char *buf, size_t nchars, const char *fmt, va_list ap);
wchar_t *str_widen(const char *src);
void str_replace(char *str, char cur, char new);
void wstr_cat(wchar_t *dest, size_t dnchars, const wchar_t *src);
void wstr_cpy(wchar_t *dest, size_t dnchars, const wchar_t *src);