1
0
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:
Ruben De Smet
2016-01-05 18:34:45 +01:00
committed by Michał Janiszewski
parent 8997f2aa6a
commit c675993d3f

View File

@@ -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);