summaryrefslogtreecommitdiff
path: root/plugins/NewsAggregator/Src/CheckFeed.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/NewsAggregator/Src/CheckFeed.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/NewsAggregator/Src/CheckFeed.cpp')
-rw-r--r--plugins/NewsAggregator/Src/CheckFeed.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/plugins/NewsAggregator/Src/CheckFeed.cpp b/plugins/NewsAggregator/Src/CheckFeed.cpp
index 68736cebdb..9e156a3162 100644
--- a/plugins/NewsAggregator/Src/CheckFeed.cpp
+++ b/plugins/NewsAggregator/Src/CheckFeed.cpp
@@ -47,7 +47,7 @@ TCHAR* CheckFeed(TCHAR *tszURL, HWND hwndDlg)
HXML child = xi.getChild(chan, j);
if (!mir_tstrcmpi(xi.getName(child), _T("title"))) {
TCHAR mes[MAX_PATH];
- mir_sntprintf(mes, SIZEOF(mes), TranslateT("%s\nis a valid feed's address."), tszURL);
+ mir_sntprintf(mes, _countof(mes), TranslateT("%s\nis a valid feed's address."), tszURL);
MessageBox(hwndDlg, mes, TranslateT("News Aggregator"), MB_OK | MB_ICONINFORMATION);
TCHAR *tszTitle = (TCHAR *)xi.getText(child);
return tszTitle;
@@ -59,7 +59,7 @@ TCHAR* CheckFeed(TCHAR *tszURL, HWND hwndDlg)
HXML child = xi.getChild(node, j);
if (!mir_tstrcmpi(xi.getName(child), _T("title"))) {
TCHAR mes[MAX_PATH];
- mir_sntprintf(mes, SIZEOF(mes), TranslateT("%s\nis a valid feed's address."), tszURL);
+ mir_sntprintf(mes, _countof(mes), TranslateT("%s\nis a valid feed's address."), tszURL);
MessageBox(hwndDlg, mes, TranslateT("News Aggregator"), MB_OK | MB_ICONINFORMATION);
TCHAR *tszTitle = (TCHAR *)xi.getText(child);
return tszTitle;
@@ -73,7 +73,7 @@ TCHAR* CheckFeed(TCHAR *tszURL, HWND hwndDlg)
}
Netlib_LogfT(hNetlibUser, _T("%s is not a valid feed's address."), tszURL);
TCHAR mes[MAX_PATH];
- mir_sntprintf(mes, SIZEOF(mes), TranslateT("%s\nis not a valid feed's address."), tszURL);
+ mir_sntprintf(mes, _countof(mes), TranslateT("%s\nis not a valid feed's address."), tszURL);
MessageBox(hwndDlg, mes, TranslateT("News Aggregator"), MB_OK | MB_ICONERROR);
return NULL;
}
@@ -199,7 +199,7 @@ void CheckCurrentFeed(MCONTACT hContact)
LPCTSTR szAttrName = xi.getAttrName(node, i);
if (!mir_tstrcmpi(szAttrName, _T("version"))) {
TCHAR ver[MAX_PATH];
- mir_sntprintf(ver, SIZEOF(ver), _T("RSS %s"), xi.getAttrValue(node, szAttrName));
+ mir_sntprintf(ver, _countof(ver), _T("RSS %s"), xi.getAttrValue(node, szAttrName));
db_set_ts(hContact, MODULE, "MirVer", ver);
break;
}
@@ -267,7 +267,7 @@ void CheckCurrentFeed(MCONTACT hContact)
CMString filename = szNick;
filename.Replace(_T("/"), _T("_"));
- mir_sntprintf(ai.filename, SIZEOF(ai.filename), _T("%s\\%s.%s"), tszRoot, filename.c_str(), ext);
+ mir_sntprintf(ai.filename, _countof(ai.filename), _T("%s\\%s.%s"), tszRoot, filename.c_str(), ext);
CreateDirectoryTreeT(tszRoot);
if (DownloadFile(url, ai.filename)) {
db_set_ts(hContact, MODULE, "ImagePath", ai.filename);
@@ -393,7 +393,7 @@ void CheckCurrentFeed(MCONTACT hContact)
ai.format = ProtoGetAvatarFormat(ext);
TCHAR *filename = szNick;
- mir_sntprintf(ai.filename, SIZEOF(ai.filename), _T("%s\\%s.%s"), tszRoot, filename, ext);
+ mir_sntprintf(ai.filename, _countof(ai.filename), _T("%s\\%s.%s"), tszRoot, filename, ext);
if (DownloadFile(url, ai.filename)) {
db_set_ts(hContact, MODULE, "ImagePath", ai.filename);
ProtoBroadcastAck(MODULE, hContact, ACKTYPE_AVATAR, ACKRESULT_SUCCESS, (HANDLE)&ai, NULL);
@@ -538,7 +538,7 @@ void CheckCurrentFeedAvatar(MCONTACT hContact)
ai.format = ProtoGetAvatarFormat(ext);
TCHAR *filename = szNick;
- mir_sntprintf(ai.filename, SIZEOF(ai.filename), _T("%s\\%s.%s"), tszRoot, filename, ext);
+ mir_sntprintf(ai.filename, _countof(ai.filename), _T("%s\\%s.%s"), tszRoot, filename, ext);
if (DownloadFile(url, ai.filename)) {
db_set_ts(hContact, MODULE, "ImagePath", ai.filename);
ProtoBroadcastAck(MODULE, hContact, ACKTYPE_AVATAR, ACKRESULT_SUCCESS, (HANDLE)&ai, NULL);
@@ -571,7 +571,7 @@ void CheckCurrentFeedAvatar(MCONTACT hContact)
ai.format = ProtoGetAvatarFormat(ext);
TCHAR *filename = szNick;
- mir_sntprintf(ai.filename, SIZEOF(ai.filename), _T("%s\\%s.%s"), tszRoot, filename, ext);
+ mir_sntprintf(ai.filename, _countof(ai.filename), _T("%s\\%s.%s"), tszRoot, filename, ext);
if (DownloadFile(url, ai.filename)) {
db_set_ts(hContact, MODULE, "ImagePath", ai.filename);
ProtoBroadcastAck(MODULE, hContact, ACKTYPE_AVATAR, ACKRESULT_SUCCESS, (HANDLE)&ai, NULL);