< prev index next >

src/java.base/windows/native/libjava/canonicalize_md.c

Print this page

        

*** 332,352 **** wchar_t* wresult = NULL; int wpath_len; int ret = -1; /* Get required buffer size to convert to Unicode */ ! wpath_len = MultiByteToWideChar(CP_THREAD_ACP, MB_ERR_INVALID_CHARS, orig, -1, NULL, 0); if (wpath_len == 0) { goto finish; } if ((wpath = (wchar_t*) malloc(sizeof(wchar_t) * wpath_len)) == NULL) { goto finish; } ! if (MultiByteToWideChar(CP_THREAD_ACP, MB_ERR_INVALID_CHARS, orig, -1, wpath, wpath_len) == 0) { goto finish; } if ((wresult = (wchar_t*) malloc(sizeof(wchar_t) * len)) == NULL) { --- 332,352 ---- wchar_t* wresult = NULL; int wpath_len; int ret = -1; /* Get required buffer size to convert to Unicode */ ! wpath_len = MultiByteToWideChar(CP_ACP, MB_ERR_INVALID_CHARS, orig, -1, NULL, 0); if (wpath_len == 0) { goto finish; } if ((wpath = (wchar_t*) malloc(sizeof(wchar_t) * wpath_len)) == NULL) { goto finish; } ! if (MultiByteToWideChar(CP_ACP, MB_ERR_INVALID_CHARS, orig, -1, wpath, wpath_len) == 0) { goto finish; } if ((wresult = (wchar_t*) malloc(sizeof(wchar_t) * len)) == NULL) {
*** 355,365 **** if (wcanonicalize(wpath, wresult, len) != 0) { goto finish; } ! if (WideCharToMultiByte(CP_THREAD_ACP, 0, wresult, -1, out, len, NULL, NULL) == 0) { goto finish; } // Change return value to success. --- 355,365 ---- if (wcanonicalize(wpath, wresult, len) != 0) { goto finish; } ! if (WideCharToMultiByte(CP_ACP, 0, wresult, -1, out, len, NULL, NULL) == 0) { goto finish; } // Change return value to success.
< prev index next >