diff options
author | Kirill Volinsky <mataes2007@gmail.com> | 2014-12-31 10:37:03 +0000 |
---|---|---|
committer | Kirill Volinsky <mataes2007@gmail.com> | 2014-12-31 10:37:03 +0000 |
commit | cad77e7d51aef2c4d938fca592921e14d923f8c5 (patch) | |
tree | 84ad3fc6acc8fd0d58d843a1c99002f7f2dedf00 /plugins/NewXstatusNotify | |
parent | 5de1b2c939a26695aaab99540fe3d37527512cb3 (diff) |
minor fixes
git-svn-id: http://svn.miranda-ng.org/main/trunk@11691 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/NewXstatusNotify')
-rw-r--r-- | plugins/NewXstatusNotify/src/options.cpp | 17 | ||||
-rw-r--r-- | plugins/NewXstatusNotify/src/popup.cpp | 2 | ||||
-rw-r--r-- | plugins/NewXstatusNotify/src/utils.cpp | 2 |
3 files changed, 11 insertions, 10 deletions
diff --git a/plugins/NewXstatusNotify/src/options.cpp b/plugins/NewXstatusNotify/src/options.cpp index 7ef2e24e81..811fe50d2a 100644 --- a/plugins/NewXstatusNotify/src/options.cpp +++ b/plugins/NewXstatusNotify/src/options.cpp @@ -381,32 +381,33 @@ INT_PTR CALLBACK DlgProcPopupOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM {
TCHAR str[MAX_SECONDLINE] = { 0 };
for (int i = ID_STATUS_MIN; i <= ID_STATUS_MAX; i++) {
- _tcsncpy(str, _T(""), MAX_SECONDLINE);
+ _tcsncpy(str, _T(""), SIZEOF(str));
if (opt.ShowStatus) {
if (opt.UseAlternativeText == 1)
- _tcsncpy(str, StatusList[Index(i)].lpzUStatusText, MAX_SECONDLINE);
+ _tcsncpy(str, StatusList[Index(i)].lpzUStatusText, SIZEOF(str));
else
- _tcsncpy(str, StatusList[Index(i)].lpzStandardText, MAX_SECONDLINE);
+ _tcsncpy(str, StatusList[Index(i)].lpzStandardText, SIZEOF(str));
if (opt.ShowPreviousStatus) {
TCHAR buff[MAX_STATUSTEXT];
mir_sntprintf(buff, SIZEOF(buff), TranslateTS(STRING_SHOWPREVIOUSSTATUS), StatusList[Index(i)].lpzStandardText);
- mir_sntprintf(str, SIZEOF(str), _T("%s %s"), str, buff);
+ mir_tstrcat(str, _T(" "));
+ mir_tstrcat(str, buff);
}
}
if (opt.ReadAwayMsg) {
if (str[0])
- _tcscat(str, _T("\n"));
- _tcsncat(str, TranslateT("This is status message"), MAX_SECONDLINE);
+ mir_tstrcat(str, _T("\n"));
+ mir_tstrcat(str, TranslateT("This is status message"));
}
ShowChangePopup(NULL, LoadSkinnedProtoIcon(NULL, i), i, str);
}
- _tcsncpy(str, TranslateT("This is extra status"), MAX_SECONDLINE);
+ _tcsncpy(str, TranslateT("This is extra status"), SIZEOF(str));
ShowChangePopup(NULL, LoadSkinnedProtoIcon(NULL, ID_STATUS_ONLINE), ID_STATUS_EXTRASTATUS, str);
- _tcsncpy(str, TranslateT("This is status message"), MAX_SECONDLINE);
+ _tcsncpy(str, TranslateT("This is status message"), SIZEOF(str));
ShowChangePopup(NULL, LoadSkinnedProtoIcon(NULL, ID_STATUS_ONLINE), ID_STATUS_STATUSMSG, str);
return FALSE;
diff --git a/plugins/NewXstatusNotify/src/popup.cpp b/plugins/NewXstatusNotify/src/popup.cpp index f57710a6ee..2e37d89fa9 100644 --- a/plugins/NewXstatusNotify/src/popup.cpp +++ b/plugins/NewXstatusNotify/src/popup.cpp @@ -36,7 +36,7 @@ void ShowChangePopup(MCONTACT hContact, HICON hIcon, WORD newStatus, TCHAR *stzT }
_tcsncpy_s(ppd.lptzContactName, buf, _TRUNCATE);
- _tcsncpy(ppd.lptzText, stzText, MAX_SECONDLINE);
+ _tcsncpy(ppd.lptzText, stzText, SIZEOF(ppd.lptzText));
switch (opt.Colors) {
case POPUP_COLOR_OWN:
diff --git a/plugins/NewXstatusNotify/src/utils.cpp b/plugins/NewXstatusNotify/src/utils.cpp index 4d830172e6..c41da2cd63 100644 --- a/plugins/NewXstatusNotify/src/utils.cpp +++ b/plugins/NewXstatusNotify/src/utils.cpp @@ -117,7 +117,7 @@ TCHAR *AddCR(const TCHAR *stzText) while ((found = _tcsstr((stzText + i), _T("\n"))) != NULL && _tcslen(tmp) + 1 < 1024) {
j = (int)(found - stzText);
if (mir_tstrlen(tmp) + j - i + 2 < 1024)
- tmp = _tcsncat(tmp, stzText + i, j - i);
+ tmp = mir_tstrcat(tmp, stzText + i);
else
break;
|