< prev index next >
src/java.base/windows/native/libjli/java_md.c
Print this page
*** 502,512 ****
/*
* Get required buffer size to convert to Unicode.
* The return value includes the terminating null character.
*/
! unicode_path_len = MultiByteToWideChar(CP_THREAD_ACP, MB_ERR_INVALID_CHARS,
path, -1, NULL, 0);
if (unicode_path_len == 0) {
return EINVAL;
}
--- 502,512 ----
/*
* Get required buffer size to convert to Unicode.
* The return value includes the terminating null character.
*/
! unicode_path_len = MultiByteToWideChar(CP_ACP, MB_ERR_INVALID_CHARS,
path, -1, NULL, 0);
if (unicode_path_len == 0) {
return EINVAL;
}
*** 516,526 ****
if (*wpath == NULL) {
return ENOMEM;
}
wcsncpy(*wpath, prefix, prefix_len);
! if (MultiByteToWideChar(CP_THREAD_ACP, MB_ERR_INVALID_CHARS,
path, -1, &((*wpath)[prefix_len]), (int)wpath_len) == 0) {
JLI_MemFree(*wpath);
*wpath = NULL;
return EINVAL;
}
--- 516,526 ----
if (*wpath == NULL) {
return ENOMEM;
}
wcsncpy(*wpath, prefix, prefix_len);
! if (MultiByteToWideChar(CP_ACP, MB_ERR_INVALID_CHARS,
path, -1, &((*wpath)[prefix_len]), (int)wpath_len) == 0) {
JLI_MemFree(*wpath);
*wpath = NULL;
return EINVAL;
}
< prev index next >