diff options
author | George Hazan <george.hazan@gmail.com> | 2015-06-19 19:35:42 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2015-06-19 19:35:42 +0000 |
commit | 4c814798c7bc7f6a0f92c21b027b26290622aa2f (patch) | |
tree | 9bbfb38bd639f352300aa16ff7c45f5a9b2dba6d /plugins/AutoShutdown/src/frame.cpp | |
parent | f0f0cd088f1ec3a85abee825ddbc214f3f6b92c3 (diff) |
SIZEOF replaced with more secure analog - _countof
git-svn-id: http://svn.miranda-ng.org/main/trunk@14270 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/AutoShutdown/src/frame.cpp')
-rw-r--r-- | plugins/AutoShutdown/src/frame.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/plugins/AutoShutdown/src/frame.cpp b/plugins/AutoShutdown/src/frame.cpp index c01bf11b54..e66b12998e 100644 --- a/plugins/AutoShutdown/src/frame.cpp +++ b/plugins/AutoShutdown/src/frame.cpp @@ -358,8 +358,8 @@ static LRESULT CALLBACK FrameWndProc(HWND hwndFrame,UINT msg,WPARAM wParam,LPARA else {
TCHAR szOutput[256];
if (dat->fTimeFlags&SDWTF_ST_TIME)
- GetFormatedDateTime(szOutput,SIZEOF(szOutput),dat->settingLastTime,TRUE);
- else GetFormatedCountdown(szOutput,SIZEOF(szOutput),dat->countdown);
+ GetFormatedDateTime(szOutput,_countof(szOutput),dat->settingLastTime,TRUE);
+ else GetFormatedCountdown(szOutput,_countof(szOutput),dat->countdown);
SetWindowText(dat->hwndTime,szOutput);
PostMessage(hwndFrame,M_CHECK_CLIPPED,0,0);
/* update tooltip text (if shown) */
@@ -443,7 +443,7 @@ static LRESULT CALLBACK FrameWndProc(HWND hwndFrame,UINT msg,WPARAM wParam,LPARA HFONT hFontPrev=NULL;
TCHAR szOutput[256];
dat->flags&=~FWPDF_TIMEISCLIPPED;
- if (GetWindowText(dat->hwndTime,szOutput,SIZEOF(szOutput)))
+ if (GetWindowText(dat->hwndTime,szOutput,_countof(szOutput)))
if (GetClientRect(dat->hwndTime,&rc)) {
hdc=GetDC(dat->hwndTime);
if (hdc != NULL) {
@@ -484,17 +484,17 @@ static LRESULT CALLBACK FrameWndProc(HWND hwndFrame,UINT msg,WPARAM wParam,LPARA case TTN_NEEDTEXT:
{ NMTTDISPINFO *ttdi=(NMTTDISPINFO*)lParam;
if (dat->flags&FWPDF_TIMEISCLIPPED && (HWND)wParam==dat->hwndTime) {
- if (GetWindowText(dat->hwndTime,ttdi->szText,SIZEOF(ttdi->szText)))
+ if (GetWindowText(dat->hwndTime,ttdi->szText,_countof(ttdi->szText)))
ttdi->lpszText=ttdi->szText;
}
else if ((HWND)wParam==dat->hwndIcon)
ttdi->lpszText=TranslateT("Automatic Shutdown");
else {
- TCHAR szTime[SIZEOF(ttdi->szText)];
+ TCHAR szTime[_countof(ttdi->szText)];
if (dat->fTimeFlags&SDWTF_ST_TIME)
- GetFormatedDateTime(szTime,SIZEOF(szTime),dat->settingLastTime,FALSE);
- else GetFormatedCountdown(szTime,SIZEOF(szTime),dat->countdown);
- mir_sntprintf(ttdi->szText,SIZEOF(ttdi->szText),_T("%s %s"),(dat->fTimeFlags&SDWTF_ST_TIME)?TranslateT("Shutdown at:"):TranslateT("Time left:"),szTime);
+ GetFormatedDateTime(szTime,_countof(szTime),dat->settingLastTime,FALSE);
+ else GetFormatedCountdown(szTime,_countof(szTime),dat->countdown);
+ mir_sntprintf(ttdi->szText,_countof(ttdi->szText),_T("%s %s"),(dat->fTimeFlags&SDWTF_ST_TIME)?TranslateT("Shutdown at:"):TranslateT("Time left:"),szTime);
ttdi->lpszText=ttdi->szText;
}
return 0;
|