diff options
author | Rozhuk Ivan <rozhuk.im@gmail.com> | 2014-12-13 08:01:55 +0000 |
---|---|---|
committer | Rozhuk Ivan <rozhuk.im@gmail.com> | 2014-12-13 08:01:55 +0000 |
commit | 303e6b483aff4126701ca375dd085e9ae1d18b43 (patch) | |
tree | 148d820728544a5fd6f6e87fdffbc5b80424c457 /plugins/AvatarHistory/src | |
parent | cce79a92d5341111997eaf7fd0a420fdddc3e50d (diff) |
multiple buf size fixes
git-svn-id: http://svn.miranda-ng.org/main/trunk@11361 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/AvatarHistory/src')
-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);
|