diff options
Diffstat (limited to 'plugins/AvatarHistory')
-rw-r--r-- | plugins/AvatarHistory/src/AvatarDlg.cpp | 2 | ||||
-rw-r--r-- | plugins/AvatarHistory/src/AvatarHistory.cpp | 12 |
2 files changed, 8 insertions, 6 deletions
diff --git a/plugins/AvatarHistory/src/AvatarDlg.cpp b/plugins/AvatarHistory/src/AvatarDlg.cpp index 491d3d34be..64ac70749d 100644 --- a/plugins/AvatarHistory/src/AvatarDlg.cpp +++ b/plugins/AvatarHistory/src/AvatarDlg.cpp @@ -554,7 +554,7 @@ int ShowSaveDialog(HWND hwnd, TCHAR* fn, MCONTACT hContact) ofn.lpstrFilter = filter;
ofn.nFilterIndex = 1;
- mir_tstrncpy(file, _tcsrchr(fn, '\\')+1, sizeof(file));
+ _tcsncpy_s(file, (_tcsrchr(fn, '\\') + 1), _TRUNCATE);
ofn.lpstrFile = file;
TCHAR *displayName = (TCHAR*) CallService(MS_CLIST_GETCONTACTDISPLAYNAME,hContact,GCDNF_TCHAR);
diff --git a/plugins/AvatarHistory/src/AvatarHistory.cpp b/plugins/AvatarHistory/src/AvatarHistory.cpp index cd3489212b..1f98aa149a 100644 --- a/plugins/AvatarHistory/src/AvatarHistory.cpp +++ b/plugins/AvatarHistory/src/AvatarHistory.cpp @@ -75,9 +75,10 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) static INT_PTR GetCachedAvatar(WPARAM wParam, LPARAM lParam)
{
TCHAR hash[128];
- mir_tstrncpy(hash, (TCHAR *) lParam, sizeof(hash));
- ConvertToFilename(hash, sizeof(hash));
- return (INT_PTR) GetCachedAvatar((char *) wParam, hash);
+
+ _tcsncpy_s(hash, (TCHAR*)lParam, _TRUNCATE);
+ ConvertToFilename(hash, SIZEOF(hash));
+ return (INT_PTR)GetCachedAvatar((char*)wParam, hash);
}
static INT_PTR IsEnabled(WPARAM wParam, LPARAM lParam)
@@ -169,8 +170,9 @@ static int AvatarChanged(WPARAM hContact, LPARAM lParam) else {
// See if we already have the avatar
TCHAR hash[128];
- mir_tstrncpy(hash, avatar->hash, sizeof(hash));
- ConvertToFilename(hash, sizeof(hash));
+
+ _tcsncpy_s(hash, avatar->hash, _TRUNCATE);
+ ConvertToFilename(hash, SIZEOF(hash));
TCHAR *file = GetCachedAvatar(proto, hash);
|