diff options
author | George Hazan <george.hazan@gmail.com> | 2015-08-27 21:42:44 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2015-08-27 21:42:44 +0000 |
commit | 17501083ca15adc9e3f53757b47a961ed2e77e9c (patch) | |
tree | e6a88938fd555265d20bf4281765c84fb874bc18 /plugins/WhenWasIt | |
parent | 18fb3c2f6c84e3242df27a8686da95658584f7a8 (diff) |
warning fixes
git-svn-id: http://svn.miranda-ng.org/main/trunk@15051 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/WhenWasIt')
-rw-r--r-- | plugins/WhenWasIt/src/services.cpp | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/plugins/WhenWasIt/src/services.cpp b/plugins/WhenWasIt/src/services.cpp index ecfe1bbfbe..9b58a1bfd4 100644 --- a/plugins/WhenWasIt/src/services.cpp +++ b/plugins/WhenWasIt/src/services.cpp @@ -176,12 +176,12 @@ INT_PTR AddBirthdayService(WPARAM hContact, LPARAM) return ShowWindow(hWnd, SW_SHOW);
}
-void ShowPopupMessage(TCHAR *title, TCHAR *message, HANDLE icon)
+void ShowPopupMessage(const TCHAR *title, const TCHAR *message, HANDLE icon)
{
POPUPDATAT pd = { 0 };
pd.lchIcon = IcoLib_GetIconByHandle(icon);
- _tcsncpy(pd.lptzContactName, title, MAX_CONTACTNAME - 1);
- _tcsncpy(pd.lptzText, message, MAX_SECONDLINE - 1);
+ _tcsncpy_s(pd.lptzContactName, title, _TRUNCATE);
+ _tcsncpy_s(pd.lptzText, message, _TRUNCATE);
pd.colorText = commonData.foreground;
pd.colorBack = commonData.background;
PUAddPopupT(&pd);
@@ -191,11 +191,10 @@ void __cdecl RefreshUserDetailsWorkerThread(void*) {
ShowPopupMessage(TranslateT("WhenWasIt"), TranslateT("Starting to refresh user details"), hRefreshUserDetails);
int delay = db_get_w(NULL, ModuleName, "UpdateDelay", REFRESH_DETAILS_DELAY);
- int res;
MCONTACT hContact = db_find_first();
while (hContact != NULL) {
- res = CallContactService(hContact, PSS_GETINFO, 0, 0);
+ int res = CallContactService(hContact, PSS_GETINFO, 0, 0);
hContact = db_find_next(hContact);
if (hContact)
Sleep(delay); //sleep for a few seconds between requests
@@ -298,9 +297,8 @@ int DoImport(TCHAR *fileName) SaveBirthday(hContact, year, month, day, mode);
}
else {
- TCHAR tmp[2048];
- mir_sntprintf(tmp, _countof(tmp), TranslateT(NOTFOUND_FORMAT), szHandle, szProto);
- ShowPopupMessage(TranslateT("Warning"), tmp, hImportBirthdays);
+ CMString msg(FORMAT, TranslateT(NOTFOUND_FORMAT), szHandle, szProto);
+ ShowPopupMessage(TranslateT("Warning"), msg, hImportBirthdays);
}
}
}
|