mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2026-01-06 06:32:56 +01:00
Fix a bug where some paths get truncated on posix.
Especially when editing the title screen on.
This commit is contained in:
committed by
Michał Janiszewski
parent
8997f2aa6a
commit
c675993d3f
@@ -152,10 +152,10 @@ bool platform_ensure_directory_exists(const utf8 *path)
|
||||
mode_t mask = getumask();
|
||||
|
||||
wchar_t *wPath = utf8_to_widechar(path);
|
||||
int len = min(MAX_PATH, utf8_length(path));
|
||||
int len = min(MAX_PATH - 1, utf8_length(path));
|
||||
char buffer[MAX_PATH];
|
||||
wcstombs(buffer, wPath, len);
|
||||
buffer[len - 1] = '\0';
|
||||
buffer[len] = '\0';
|
||||
free(wPath);
|
||||
log_verbose("%s", buffer);
|
||||
const int result = mkdir(buffer, mask);
|
||||
|
||||
Reference in New Issue
Block a user