summaryrefslogtreecommitdiff
path: root/plugins/NewXstatusNotify/src/indsnd.cpp
diff options
context:
space:
mode:
authorTobias Weimer <wishmaster51@googlemail.com>2015-03-01 17:40:01 +0000
committerTobias Weimer <wishmaster51@googlemail.com>2015-03-01 17:40:01 +0000
commitce745b5c14b000c3aec9b9c92769da5adebda5e9 (patch)
tree22904d2eecbe6022f884529b6b535e8b25bdf2ae /plugins/NewXstatusNotify/src/indsnd.cpp
parent8e84435e099c09fc304d0bcc9a0bed3537ca582e (diff)
NewXStatusNotify:
- minor bugfixes git-svn-id: http://svn.miranda-ng.org/main/trunk@12292 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/NewXstatusNotify/src/indsnd.cpp')
-rw-r--r--plugins/NewXstatusNotify/src/indsnd.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/plugins/NewXstatusNotify/src/indsnd.cpp b/plugins/NewXstatusNotify/src/indsnd.cpp
index a8d421353c..66f761b171 100644
--- a/plugins/NewXstatusNotify/src/indsnd.cpp
+++ b/plugins/NewXstatusNotify/src/indsnd.cpp
@@ -58,7 +58,7 @@ BOOL RemoveSoundFromList(HWND hList)
return FALSE;
}
-TCHAR *SelectSound(HWND hwndDlg, TCHAR *buff)
+TCHAR *SelectSound(HWND hwndDlg, TCHAR *buff, size_t bufflen)
{
OPENFILENAME ofn = { 0 };
@@ -171,11 +171,11 @@ INT_PTR CALLBACK DlgProcSoundUIPage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA
lvi.iItem = ListView_InsertItem(hList, &lvi);
if (!db_get_ts(hContact, MODULE, StatusList[i].lpzSkinSoundName, &dbv)) {
- _tcscpy(buff, dbv.ptszVal);
+ _tcsncpy(buff, dbv.ptszVal, SIZEOF(buff)-1);
db_free(&dbv);
}
else
- _tcscpy(buff, TranslateT(DEFAULT_SOUND));
+ _tcsncpy(buff, TranslateT(DEFAULT_SOUND), SIZEOF(buff)-1);
ListView_SetItemText(hList, lvi.iItem, 1, buff);
}
@@ -203,7 +203,7 @@ INT_PTR CALLBACK DlgProcSoundUIPage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA
int iSel = ListView_GetNextItem(GetDlgItem(hwndDlg, IDC_INDSNDLIST), -1, LVNI_SELECTED);
if (iSel != -1) {
TCHAR stzFilePath[MAX_PATH];
- if (SelectSound(hwndDlg, stzFilePath) != NULL) {
+ if (SelectSound(hwndDlg, stzFilePath, MAX_PATH - 1) != NULL) {
iSel = -1;
while ((iSel = ListView_GetNextItem(hList, iSel, LVNI_SELECTED)) != -1)
ListView_SetItemText(hList, iSel, 1, stzFilePath);
@@ -263,7 +263,7 @@ INT_PTR CALLBACK DlgProcSoundUIPage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA
case IDC_INDSNDLIST:
if (((LPNMHDR)lParam)->code == NM_DBLCLK) {
TCHAR stzFilePath[MAX_PATH];
- if (SelectSound(hwndDlg, stzFilePath) != NULL) {
+ if (SelectSound(hwndDlg, stzFilePath, MAX_PATH - 1) != NULL) {
int iSel = -1;
HWND hList = GetDlgItem(hwndDlg, IDC_INDSNDLIST);
while ((iSel = ListView_GetNextItem(hList, iSel, LVNI_SELECTED)) != -1)