From a8a11e811c3c0cc3f6d74c18c89841e9e0e87237 Mon Sep 17 00:00:00 2001 From: Rozhuk Ivan Date: Sun, 30 Nov 2014 04:29:19 +0000 Subject: Multiple fixes buff size for GetText and SetText. git-svn-id: http://svn.miranda-ng.org/main/trunk@11165 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/WhenWasIt/src/dlg_handlers.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'plugins/WhenWasIt') diff --git a/plugins/WhenWasIt/src/dlg_handlers.cpp b/plugins/WhenWasIt/src/dlg_handlers.cpp index 7331cf93f7..ea306c9e1e 100644 --- a/plugins/WhenWasIt/src/dlg_handlers.cpp +++ b/plugins/WhenWasIt/src/dlg_handlers.cpp @@ -123,7 +123,7 @@ SIZE GetControlTextSize(HWND hCtrl) const size_t maxSize = 2048; TCHAR buffer[maxSize]; SIZE size; - GetWindowText(hCtrl, buffer, maxSize); + GetWindowText(hCtrl, buffer, SIZEOF(buffer)); GetTextExtentPoint32(hDC, buffer, (int) _tcslen(buffer), &size); SelectObject(hDC, oldFont); ReleaseDC(hCtrl, hDC); @@ -306,22 +306,22 @@ INT_PTR CALLBACK DlgProcOptions(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lPara const int maxSize = 1024; TCHAR buffer[maxSize]; - GetWindowText(GetDlgItem(hWnd, IDC_DAYS_IN_ADVANCE), buffer, maxSize); + GetWindowText(GetDlgItem(hWnd, IDC_DAYS_IN_ADVANCE), buffer, SIZEOF(buffer)); TCHAR *stop = NULL; commonData.daysInAdvance = _tcstol(buffer, &stop, 10); if (*stop) { commonData.daysInAdvance = DAYS_TO_NOTIFY; } - GetWindowText(GetDlgItem(hWnd, IDC_DAYS_AFTER), buffer, maxSize); + GetWindowText(GetDlgItem(hWnd, IDC_DAYS_AFTER), buffer, SIZEOF(buffer)); commonData.daysAfter = _tcstol(buffer, &stop, 10); if (*stop) { commonData.daysAfter = DAYS_TO_NOTIFY_AFTER; } - GetWindowText(GetDlgItem(hWnd, IDC_CHECK_INTERVAL), buffer, maxSize); + GetWindowText(GetDlgItem(hWnd, IDC_CHECK_INTERVAL), buffer, SIZEOF(buffer)); commonData.checkInterval = _ttol(buffer); if ( !commonData.checkInterval) { commonData.checkInterval = CHECK_INTERVAL; } - GetWindowText(GetDlgItem(hWnd, IDC_POPUP_TIMEOUT), buffer, maxSize); + GetWindowText(GetDlgItem(hWnd, IDC_POPUP_TIMEOUT), buffer, SIZEOF(buffer)); TCHAR *pos; pos = _tcschr(buffer, _T('|')); if (pos) { @@ -338,12 +338,12 @@ INT_PTR CALLBACK DlgProcOptions(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lPara } else commonData.popupTimeout = commonData.popupTimeoutToday = _ttol(buffer); - GetWindowText(GetDlgItem(hWnd, IDC_SOUND_NEAR_DAYS_EDIT), buffer, maxSize); + GetWindowText(GetDlgItem(hWnd, IDC_SOUND_NEAR_DAYS_EDIT), buffer, SIZEOF(buffer)); //cSoundNearDays = _ttol(buffer); commonData.cSoundNearDays = _tcstol(buffer, &stop, 10); if (*stop) { commonData.cSoundNearDays = BIRTHDAY_NEAR_DEFAULT_DAYS; } - GetWindowText(GetDlgItem(hWnd, IDC_DLG_TIMEOUT), buffer, maxSize); + GetWindowText(GetDlgItem(hWnd, IDC_DLG_TIMEOUT), buffer, SIZEOF(buffer)); commonData.cDlgTimeout = _tcstol(buffer, &stop, 10); if (*stop) { commonData.cDlgTimeout = POPUP_TIMEOUT; } -- cgit v1.2.3