< prev index next >
src/java.desktop/windows/native/libawt/windows/awt_TrayIcon.cpp
Print this page
*** 707,717 ****
void AwtTrayIcon::SetToolTip(LPCTSTR tooltip)
{
if (tooltip == NULL) {
m_nid.szTip[0] = '\0';
! } else if (lstrlen(tooltip) > TRAY_ICON_TOOLTIP_MAX_SIZE) {
_tcsncpy(m_nid.szTip, tooltip, TRAY_ICON_TOOLTIP_MAX_SIZE);
m_nid.szTip[TRAY_ICON_TOOLTIP_MAX_SIZE - 1] = '\0';
} else {
_tcscpy_s(m_nid.szTip, TRAY_ICON_TOOLTIP_MAX_SIZE, tooltip);
}
--- 707,717 ----
void AwtTrayIcon::SetToolTip(LPCTSTR tooltip)
{
if (tooltip == NULL) {
m_nid.szTip[0] = '\0';
! } else if (lstrlen(tooltip) >= TRAY_ICON_TOOLTIP_MAX_SIZE) {
_tcsncpy(m_nid.szTip, tooltip, TRAY_ICON_TOOLTIP_MAX_SIZE);
m_nid.szTip[TRAY_ICON_TOOLTIP_MAX_SIZE - 1] = '\0';
} else {
_tcscpy_s(m_nid.szTip, TRAY_ICON_TOOLTIP_MAX_SIZE, tooltip);
}
*** 812,822 ****
}
if (caption[0] == '\0') {
m_nid.szInfoTitle[0] = '\0';
! } else if (lstrlen(caption) > TRAY_ICON_BALLOON_TITLE_MAX_SIZE) {
_tcsncpy(m_nid.szInfoTitle, caption, TRAY_ICON_BALLOON_TITLE_MAX_SIZE);
m_nid.szInfoTitle[TRAY_ICON_BALLOON_TITLE_MAX_SIZE - 1] = '\0';
} else {
--- 812,822 ----
}
if (caption[0] == '\0') {
m_nid.szInfoTitle[0] = '\0';
! } else if (lstrlen(caption) >= TRAY_ICON_BALLOON_TITLE_MAX_SIZE) {
_tcsncpy(m_nid.szInfoTitle, caption, TRAY_ICON_BALLOON_TITLE_MAX_SIZE);
m_nid.szInfoTitle[TRAY_ICON_BALLOON_TITLE_MAX_SIZE - 1] = '\0';
} else {
*** 825,835 ****
if (text[0] == '\0') {
m_nid.szInfo[0] = ' ';
m_nid.szInfo[1] = '\0';
! } else if (lstrlen(text) > TRAY_ICON_BALLOON_INFO_MAX_SIZE) {
_tcsncpy(m_nid.szInfo, text, TRAY_ICON_BALLOON_INFO_MAX_SIZE);
m_nid.szInfo[TRAY_ICON_BALLOON_INFO_MAX_SIZE - 1] = '\0';
} else {
--- 825,835 ----
if (text[0] == '\0') {
m_nid.szInfo[0] = ' ';
m_nid.szInfo[1] = '\0';
! } else if (lstrlen(text) >= TRAY_ICON_BALLOON_INFO_MAX_SIZE) {
_tcsncpy(m_nid.szInfo, text, TRAY_ICON_BALLOON_INFO_MAX_SIZE);
m_nid.szInfo[TRAY_ICON_BALLOON_INFO_MAX_SIZE - 1] = '\0';
} else {
< prev index next >