< prev index next >

src/java.desktop/unix/native/libawt_xawt/awt/awt_InputMethod.c

Print this page
rev 16167 : 8170525: Fix minor issues in awt coding

*** 1233,1248 **** currentX11InputMethodInstance = (jobject)client_data; if (status_draw->type == XIMTextType){ XIMText *text = (status_draw->data).text; if (text != NULL){ ! if (text->string.multi_byte != NULL){ ! strcpy(statusWindow->status, text->string.multi_byte); } ! else{ char *mbstr = wcstombsdmp(text->string.wide_char, text->length); ! strcpy(statusWindow->status, mbstr); } statusWindow->on = True; onoffStatusWindow(pX11IMData, statusWindow->parent, True); paintStatusWindow(statusWindow); } --- 1233,1250 ---- currentX11InputMethodInstance = (jobject)client_data; if (status_draw->type == XIMTextType){ XIMText *text = (status_draw->data).text; if (text != NULL){ ! if (text->string.multi_byte != NULL) { ! strncpy(statusWindow->status, text->string.multi_byte, MAX_STATUS_LEN); ! statusWindow->status[MAX_STATUS_LEN-1] = '\0'; } ! else { char *mbstr = wcstombsdmp(text->string.wide_char, text->length); ! strncpy(statusWindow->status, mbstr, MAX_STATUS_LEN); ! statusWindow->status[MAX_STATUS_LEN-1] = '\0'; } statusWindow->on = True; onoffStatusWindow(pX11IMData, statusWindow->parent, True); paintStatusWindow(statusWindow); }
< prev index next >