Skip to content

Commit

Permalink
Add comment for the error case
Browse files Browse the repository at this point in the history
  • Loading branch information
naotoj committed Aug 2, 2024
1 parent 707a1bd commit 6a92ed2
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/java.base/share/native/launcher/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,8 @@ main(int argc, char **argv)
int mbSize = WideCharToMultiByte(CP_ACP,
WC_NO_BEST_FIT_CHARS | WC_COMPOSITECHECK | WC_DEFAULTCHAR,
wcCmdline, -1, NULL, 0, NULL, NULL);
// If the call to WideCharToMultiByte() fails, it returns 0, which
// will then make the following JLI_MemAlloc() to issue exit(1)
LPSTR mbCmdline = JLI_MemAlloc(mbSize);
if (WideCharToMultiByte(CP_ACP, WC_NO_BEST_FIT_CHARS | WC_COMPOSITECHECK | WC_DEFAULTCHAR,
wcCmdline, -1, mbCmdline, mbSize, NULL, NULL) == 0) {
Expand Down

0 comments on commit 6a92ed2

Please sign in to comment.