summaryrefslogtreecommitdiff
path: root/plugins/UserInfoEx/src/svc_reminder.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2015-06-19 19:35:42 +0000
committerGeorge Hazan <george.hazan@gmail.com>2015-06-19 19:35:42 +0000
commit4c814798c7bc7f6a0f92c21b027b26290622aa2f (patch)
tree9bbfb38bd639f352300aa16ff7c45f5a9b2dba6d /plugins/UserInfoEx/src/svc_reminder.cpp
parentf0f0cd088f1ec3a85abee825ddbc214f3f6b92c3 (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/UserInfoEx/src/svc_reminder.cpp')
-rw-r--r--plugins/UserInfoEx/src/svc_reminder.cpp32
1 files changed, 16 insertions, 16 deletions
diff --git a/plugins/UserInfoEx/src/svc_reminder.cpp b/plugins/UserInfoEx/src/svc_reminder.cpp
index 62b097bf4e..82936b60ab 100644
--- a/plugins/UserInfoEx/src/svc_reminder.cpp
+++ b/plugins/UserInfoEx/src/svc_reminder.cpp
@@ -148,7 +148,7 @@ static HICON GetAnnivIcon(const CEvent &evt)
if (evt._wDaysLeft > 9)
hIcon = IcoLib_GetIcon(ICO_RMD_DTBX);
else {
- mir_snprintf(szIcon, SIZEOF(szIcon), MODNAME"_rmd_dtb%u", evt._wDaysLeft);
+ mir_snprintf(szIcon, _countof(szIcon), MODNAME"_rmd_dtb%u", evt._wDaysLeft);
hIcon = IcoLib_GetIcon(szIcon);
}
break;
@@ -157,7 +157,7 @@ static HICON GetAnnivIcon(const CEvent &evt)
if (evt._wDaysLeft > 9)
hIcon = IcoLib_GetIcon(ICO_RMD_DTAX);
else {
- mir_snprintf(szIcon, SIZEOF(szIcon), MODNAME"_rmd_dta%u", evt._wDaysLeft);
+ mir_snprintf(szIcon, _countof(szIcon), MODNAME"_rmd_dta%u", evt._wDaysLeft);
hIcon = IcoLib_GetIcon(szIcon);
}
}
@@ -183,7 +183,7 @@ static void NotifyWithExtraIcon(MCONTACT hContact, const CEvent &evt)
if (evt._wDaysLeft > 9)
icoName = ICO_RMD_DTAX;
else {
- mir_snprintf(szIcon, SIZEOF(szIcon), MODNAME"_rmd_dtb%u", evt._wDaysLeft);
+ mir_snprintf(szIcon, _countof(szIcon), MODNAME"_rmd_dtb%u", evt._wDaysLeft);
icoName = szIcon;
}
break;
@@ -192,7 +192,7 @@ static void NotifyWithExtraIcon(MCONTACT hContact, const CEvent &evt)
if (evt._wDaysLeft > 9)
icoName = ICO_RMD_DTAX;
else {
- mir_snprintf(szIcon, SIZEOF(szIcon), MODNAME"_rmd_dta%u", evt._wDaysLeft);
+ mir_snprintf(szIcon, _countof(szIcon), MODNAME"_rmd_dta%u", evt._wDaysLeft);
icoName = szIcon;
}
break;
@@ -255,10 +255,10 @@ static int NotifyWithPopup(MCONTACT hContact, CEvent::EType eventType, int DaysT
if (hContact) {
ppd.lchContact = hContact;
- mir_sntprintf(ppd.lptzContactName, SIZEOF(ppd.lptzContactName),
+ mir_sntprintf(ppd.lptzContactName, _countof(ppd.lptzContactName),
_T("%s - %s"), TranslateTS(pszDesc), DB::Contact::DisplayName(hContact));
}
- else mir_tstrncpy(ppd.lptzContactName, TranslateT("Reminder"), SIZEOF(ppd.lptzContactName));
+ else mir_tstrncpy(ppd.lptzContactName, TranslateT("Reminder"), _countof(ppd.lptzContactName));
mir_tstrncpy(ppd.lptzText, pszMsg, MAX_SECONDLINE);
@@ -318,12 +318,12 @@ static void NotifyFlashCListIcon(MCONTACT hContact, const CEvent &evt)
switch (evt._eType) {
case CEvent::BIRTHDAY:
- mir_sntprintf(szMsg, SIZEOF(szMsg), TranslateT("%s has %s today."), DB::Contact::DisplayName(hContact), TranslateT("Birthday"));
+ mir_sntprintf(szMsg, _countof(szMsg), TranslateT("%s has %s today."), DB::Contact::DisplayName(hContact), TranslateT("Birthday"));
cle.hIcon = IcoLib_GetIcon(ICO_COMMON_BIRTHDAY);
break;
case CEvent::ANNIVERSARY:
- mir_sntprintf(szMsg, SIZEOF(szMsg), TranslateT("%s has %s today."), DB::Contact::DisplayName(hContact), TranslateT("an anniversary"));
+ mir_sntprintf(szMsg, _countof(szMsg), TranslateT("%s has %s today."), DB::Contact::DisplayName(hContact), TranslateT("an anniversary"));
cle.hIcon = IcoLib_GetIcon(ICO_COMMON_ANNIVERSARY);
break;
@@ -483,29 +483,29 @@ static bool CheckBirthday(MCONTACT hContact, MTime &Now, CEvent &evt, BYTE bNoti
switch (Diff) {
case 0:
- cchMsg = mir_sntprintf(szMsg, SIZEOF(szMsg), TranslateT("%s has birthday today."), DB::Contact::DisplayName(hContact));
+ cchMsg = mir_sntprintf(szMsg, _countof(szMsg), TranslateT("%s has birthday today."), DB::Contact::DisplayName(hContact));
break;
case 1:
- cchMsg = mir_sntprintf(szMsg, SIZEOF(szMsg), TranslateT("%s has birthday tomorrow."), DB::Contact::DisplayName(hContact));
+ cchMsg = mir_sntprintf(szMsg, _countof(szMsg), TranslateT("%s has birthday tomorrow."), DB::Contact::DisplayName(hContact));
break;
default:
- cchMsg = mir_sntprintf(szMsg, SIZEOF(szMsg), TranslateT("%s has birthday in %d days."), DB::Contact::DisplayName(hContact), Diff);
+ cchMsg = mir_sntprintf(szMsg, _countof(szMsg), TranslateT("%s has birthday in %d days."), DB::Contact::DisplayName(hContact), Diff);
}
int age = mtb.Age(&Now);
if (age > 0)
switch (GenderOf(hContact)){
case 0:
- mir_sntprintf(szMsg + cchMsg, SIZEOF(szMsg) - cchMsg,
+ mir_sntprintf(szMsg + cchMsg, _countof(szMsg) - cchMsg,
TranslateT("\nHe/she becomes %d years old."),
age + (Diff > 0));
break;
case 'M':
- mir_sntprintf(szMsg + cchMsg, SIZEOF(szMsg) - cchMsg,
+ mir_sntprintf(szMsg + cchMsg, _countof(szMsg) - cchMsg,
TranslateT("\nHe becomes %d years old."),
age + (Diff > 0));
break;
case 'F':
- mir_sntprintf(szMsg + cchMsg, SIZEOF(szMsg) - cchMsg,
+ mir_sntprintf(szMsg + cchMsg, _countof(szMsg) - cchMsg,
TranslateT("\nShe becomes %d years old."),
age + (Diff > 0));
break;
@@ -600,10 +600,10 @@ void SvcReminderCheckAll(const ENotify notify)
static int OnCListRebuildIcons(WPARAM, LPARAM)
{
- for (int i = 0; i < SIZEOF(ghCListAnnivIcons); i++)
+ for (int i = 0; i < _countof(ghCListAnnivIcons); i++)
ghCListAnnivIcons[i] = INVALID_HANDLE_VALUE;
- for (int k = 0; k < SIZEOF(ghCListBirthdayIcons); k++)
+ for (int k = 0; k < _countof(ghCListBirthdayIcons); k++)
ghCListBirthdayIcons[k] = INVALID_HANDLE_VALUE;
return 0;