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/UserInfoEx/src/classMAnnivDate.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/UserInfoEx/src/classMAnnivDate.cpp')
-rw-r--r-- | plugins/UserInfoEx/src/classMAnnivDate.cpp | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/plugins/UserInfoEx/src/classMAnnivDate.cpp b/plugins/UserInfoEx/src/classMAnnivDate.cpp index c3a8cee0a6..6515cb28a5 100644 --- a/plugins/UserInfoEx/src/classMAnnivDate.cpp +++ b/plugins/UserInfoEx/src/classMAnnivDate.cpp @@ -270,10 +270,10 @@ int MAnnivDate::DBGetReminderOpts(MCONTACT hContact) char pszSetting[MAXSETTING];
// read reminder option
- mir_snprintf(pszSetting, SIZEOF(pszSetting), "Anniv%dReminder", _wID);
+ mir_snprintf(pszSetting, _countof(pszSetting), "Anniv%dReminder", _wID);
_bRemind = db_get_b(hContact, Module(), pszSetting, BST_INDETERMINATE);
// read offset
- mir_snprintf(pszSetting, SIZEOF(pszSetting), "Anniv%dOffset", _wID);
+ mir_snprintf(pszSetting, _countof(pszSetting), "Anniv%dOffset", _wID);
_wDaysEarlier = db_get_w(hContact, Module(), pszSetting, (WORD)-1);
}
else {
@@ -309,14 +309,14 @@ int MAnnivDate::DBWriteReminderOpts(MCONTACT hContact) else if (_wID <= ANID_LAST) {
char pszSetting[MAXSETTING];
// read reminder option
- mir_snprintf(pszSetting, SIZEOF(pszSetting), "Anniv%dReminder", _wID);
+ mir_snprintf(pszSetting, _countof(pszSetting), "Anniv%dReminder", _wID);
if (_bRemind == BST_INDETERMINATE)
db_unset(hContact, USERINFO, pszSetting);
else
db_set_b(hContact, USERINFO, pszSetting, _bRemind);
// read offset
- mir_snprintf(pszSetting, SIZEOF(pszSetting), "Anniv%dOffset", _wID);
+ mir_snprintf(pszSetting, _countof(pszSetting), "Anniv%dOffset", _wID);
if (_wDaysEarlier == (WORD)-1)
db_unset(hContact, USERINFO, pszSetting);
else
@@ -626,7 +626,7 @@ int MAnnivDate::DBGetAnniversaryDate(MCONTACT hContact, WORD iIndex) // read date and convert older versions
CHAR szStamp[MAXSETTING];
- mir_snprintf(szStamp, SIZEOF(szStamp), "Anniv%dDate", iIndex);
+ mir_snprintf(szStamp, _countof(szStamp), "Anniv%dDate", iIndex);
int rc = DBGetDateStamp(hContact, USERINFO, szStamp);
if (!rc) {
_strModule = USERINFO;
@@ -634,7 +634,7 @@ int MAnnivDate::DBGetAnniversaryDate(MCONTACT hContact, WORD iIndex) _wID = iIndex;
// read description
- mir_snprintf(szStamp, SIZEOF(szStamp), "Anniv%dDesc", iIndex);
+ mir_snprintf(szStamp, _countof(szStamp), "Anniv%dDesc", iIndex);
DBVARIANT dbv;
if (!DB::Setting::GetTString(hContact, USERINFO, szStamp, &dbv)) {
_strDesc = dbv.ptszVal;
@@ -659,10 +659,10 @@ int MAnnivDate::DBWriteAnniversaryDate(MCONTACT hContact, WORD wIndex) _wID = wIndex;
CHAR pszSetting[MAXSETTING];
- mir_snprintf(pszSetting, SIZEOF(pszSetting), "Anniv%dDate", wIndex);
+ mir_snprintf(pszSetting, _countof(pszSetting), "Anniv%dDate", wIndex);
if (!DBWriteDateStamp(hContact, USERINFO, pszSetting)) {
// write description
- mir_snprintf(pszSetting, SIZEOF(pszSetting), "Anniv%dDesc", wIndex);
+ mir_snprintf(pszSetting, _countof(pszSetting), "Anniv%dDesc", wIndex);
db_set_ts(hContact, USERINFO, pszSetting, (LPTSTR)Description());
return 0;
}
@@ -683,10 +683,10 @@ static WORD AskUser(MCONTACT hContact, MAnnivDate *pOldCustomDate, MAnnivDate *p TCHAR szDate[MAX_PATH];
TCHAR szoldDate[MAX_PATH];
- pOldCustomDate->DateFormat(szoldDate, SIZEOF(szoldDate));
- pNewProtoDate->DateFormat(szDate, SIZEOF(szDate));
+ pOldCustomDate->DateFormat(szoldDate, _countof(szoldDate));
+ pNewProtoDate->DateFormat(szDate, _countof(szDate));
- mir_sntprintf(szMsg, SIZEOF(szMsg),
+ mir_sntprintf(szMsg, _countof(szMsg),
TranslateT("%s provides a new birthday via protocol.\nIt is %s. The old one was %s.\n\nDo you want to use this as the new birthday for this contact?"),
DB::Contact::DisplayName(hContact), szDate, szoldDate);
|