changeset 14021:6bfcacd030fe

7201151: Fix Contribution : Java cannot get Windows's IME name correctly Reviewed-by: okutsu
author peytoia
date Thu, 04 Oct 2012 18:05:37 +0900
parents b17c22caa38c
children 58aabbd73a9b
files jdk/src/windows/native/sun/windows/awt_InputMethod.cpp
diffstat 1 files changed, 3 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/jdk/src/windows/native/sun/windows/awt_InputMethod.cpp	Thu Oct 04 11:36:22 2012 +0900
+++ b/jdk/src/windows/native/sun/windows/awt_InputMethod.cpp	Thu Oct 04 18:05:37 2012 +0900
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -517,10 +517,10 @@
     jstring infojStr = NULL;
 
     if ((buffSize = ::ImmGetDescription(hkl, szImmDescription, 0)) > 0) {
-        szImmDescription = (LPTSTR) safe_Malloc(buffSize * sizeof(TCHAR));
+        szImmDescription = (LPTSTR) safe_Malloc((buffSize+1) * sizeof(TCHAR));
 
         if (szImmDescription != NULL) {
-            ImmGetDescription(hkl, szImmDescription, buffSize);
+            ImmGetDescription(hkl, szImmDescription, (buffSize+1));
 
             infojStr = JNU_NewStringPlatform(env, szImmDescription);