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 authored and Michał Janiszewski committed 2016-01-10 23:55:56 +01:00
1 parent 8997f2aa6a
commit c675993d3f
1 file changed
+2 -2
+2 -2
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);