diff options
author | Rozhuk Ivan <rozhuk.im@gmail.com> | 2014-11-30 18:33:56 +0000 |
---|---|---|
committer | Rozhuk Ivan <rozhuk.im@gmail.com> | 2014-11-30 18:33:56 +0000 |
commit | 4f0e30cdf56fbafdf955bbe8b93930bab9e39bd0 (patch) | |
tree | ded36ec10c55fb5d33c8d2e471ec808eeb058a04 /plugins/SendScreenshotPlus | |
parent | 237d02ebbabbedfb8b33160ebfb5250bbd491eca (diff) |
Fix buf size for Get/Set text, open/save file name
SMS: SIZE_T -> size_t
MRA: small code cleanup
git-svn-id: http://svn.miranda-ng.org/main/trunk@11175 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/SendScreenshotPlus')
-rw-r--r-- | plugins/SendScreenshotPlus/src/CSend.cpp | 2 | ||||
-rw-r--r-- | plugins/SendScreenshotPlus/src/UMainForm.cpp | 8 | ||||
-rw-r--r-- | plugins/SendScreenshotPlus/src/ctrl_button.cpp | 2 |
3 files changed, 6 insertions, 6 deletions
diff --git a/plugins/SendScreenshotPlus/src/CSend.cpp b/plugins/SendScreenshotPlus/src/CSend.cpp index cb18639223..51074118d6 100644 --- a/plugins/SendScreenshotPlus/src/CSend.cpp +++ b/plugins/SendScreenshotPlus/src/CSend.cpp @@ -166,7 +166,7 @@ INT_PTR CALLBACK CSend::ResultDialogProc(HWND hwndDlg,UINT uMsg,WPARAM wParam,LP memcpy(tmp+len,_T("[/img][/url]"),13*sizeof(TCHAR)); len+=12; } }else - len=GetDlgItemText(hwndDlg,edtID,tmp,2048); + len=GetDlgItemText(hwndDlg,edtID,tmp,SIZEOF(tmp)); int retries=3; do{ if(!OpenClipboard(hwndDlg)){ diff --git a/plugins/SendScreenshotPlus/src/UMainForm.cpp b/plugins/SendScreenshotPlus/src/UMainForm.cpp index 90a980ade6..efc7063416 100644 --- a/plugins/SendScreenshotPlus/src/UMainForm.cpp +++ b/plugins/SendScreenshotPlus/src/UMainForm.cpp @@ -68,7 +68,7 @@ INT_PTR CALLBACK TfrmMain::DlgProc_CaptureTabPage(HWND hDlg, UINT uMsg, WPARAM w if(HIWORD(wParam)==BN_CLICKED && LOWORD(wParam)==ID_btnExplore){ /// local file tab OPENFILENAME ofn={sizeof(OPENFILENAME)}; TCHAR filename[MAX_PATH]; - GetDlgItemText(hDlg,ID_edtSize,filename,MAX_PATH); + GetDlgItemText(hDlg,ID_edtSize,filename,SIZEOF(filename)); ofn.lStructSize = sizeof(ofn); ofn.hwndOwner = hDlg; ofn.lpstrFilter = _T("Images\0*.png;*.jpg;*.jpeg;*.bmp;*.gif;*.tif;*.tiff\0"); @@ -781,7 +781,7 @@ void TfrmMain::btnCaptureClick() { if(m_opt_tabCapture==1) m_hTargetWindow=GetDesktopWindow(); else if(m_opt_tabCapture==2){ TCHAR filename[MAX_PATH]; - GetDlgItemText(m_hwndTabPage, ID_edtSize, filename, MAX_PATH); + GetDlgItemText(m_hwndTabPage, ID_edtSize, filename, SIZEOF(filename)); FILE* fp=_wfopen(filename,_T("rb")); if(!fp){ TCHAR *err = TranslateT("Select a file"); @@ -959,7 +959,7 @@ INT_PTR TfrmMain::SaveScreenshot(FIBITMAP* dib) { mir_tcsadd(pszFileDesc, TranslateT("for Client area ")); } mir_tcsadd(pszFileDesc, TranslateT("of \"")); - GetDlgItemText(m_hwndTabPage, ID_edtCaption, winText, 1024); + GetDlgItemText(m_hwndTabPage, ID_edtCaption, winText, SIZEOF(winText)); mir_tcsadd(pszFileDesc, winText); if(m_opt_tabCapture==1) mir_tcsadd(pszFileDesc, _T("\"")); @@ -1110,7 +1110,7 @@ INT_PTR TfrmMain::SaveScreenshot(FIBITMAP* dib) { void TfrmMain::FormClose() { if(m_opt_tabCapture==2){ /// existing file TCHAR description[1024]; - GetDlgItemText(m_hwndTabPage, ID_edtCaption, description, 1024); + GetDlgItemText(m_hwndTabPage, ID_edtCaption, description, SIZEOF(description)); if(!IsWindowEnabled(GetDlgItem(m_hWnd,ID_btnDesc)) || !m_opt_btnDesc) *description='\0'; if(m_cSend) { diff --git a/plugins/SendScreenshotPlus/src/ctrl_button.cpp b/plugins/SendScreenshotPlus/src/ctrl_button.cpp index 83ab8907ca..41773048c5 100644 --- a/plugins/SendScreenshotPlus/src/ctrl_button.cpp +++ b/plugins/SendScreenshotPlus/src/ctrl_button.cpp @@ -192,7 +192,7 @@ static void __fastcall PaintThemeButton(BTNCTRL *ctl, HDC hdcMem, LPRECT rcClien RECT sizeText; HFONT hOldFont; - ccText = GetWindowTextW(ctl->hwnd, wszText, sizeof(wszText) / sizeof(WCHAR)); + ccText = GetWindowTextW(ctl->hwnd, wszText, SIZEOF(wszText)); if (ccText > 0) { hOldFont = (HFONT)SelectObject(hdcMem, ctl->hFont); |