summaryrefslogtreecommitdiff
path: root/protocols/Omegle/src/communication.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 /protocols/Omegle/src/communication.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 'protocols/Omegle/src/communication.cpp')
-rw-r--r--protocols/Omegle/src/communication.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/protocols/Omegle/src/communication.cpp b/protocols/Omegle/src/communication.cpp
index eb7b739c75..ce0afcc440 100644
--- a/protocols/Omegle/src/communication.cpp
+++ b/protocols/Omegle/src/communication.cpp
@@ -162,12 +162,12 @@ std::string Omegle_client::get_server( bool not_last )
int q = not_last ? 1 : 0;
int server = db_get_b(NULL, parent->m_szModuleName, OMEGLE_KEY_SERVER, 0);
- if (server < 0 || server >= (int)(SIZEOF(servers)-q))
+ if (server < 0 || server >= (int)(_countof(servers)-q))
server = 0;
if (server == 0) {
srand(::time(NULL));
- server = (rand() % (SIZEOF(servers)-1-q))+1;
+ server = (rand() % (_countof(servers)-1-q))+1;
}
return servers[server];
@@ -176,7 +176,7 @@ std::string Omegle_client::get_server( bool not_last )
std::string Omegle_client::get_language()
{
int language = db_get_b(NULL, parent->m_szModuleName, OMEGLE_KEY_LANGUAGE, 0);
- if (language < 0 || language >= (SIZEOF(languages)))
+ if (language < 0 || language >= (_countof(languages)))
language = 0;
return language > 0 ? languages[language].id : "en";
@@ -300,7 +300,7 @@ bool Omegle_client::start()
if (this->spy_mode_) {
//// get last server from list, which is for spy mode
- //this->server_ = servers[SIZEOF(servers)-1];
+ //this->server_ = servers[_countof(servers)-1];
if (this->question_.empty()) {
data = "&wantsspy=1";
@@ -551,7 +551,7 @@ bool Omegle_client::events()
st.cbSize = sizeof(st);
// st.hIcon = IcoLib_GetIconByHandle(GetIconHandle("typing_on")); // TODO: typing icon
- mir_sntprintf(st.tszText, SIZEOF(st.tszText), TranslateT("%s is typing."), TranslateT("Stranger"));
+ mir_sntprintf(st.tszText, _countof(st.tszText), TranslateT("%s is typing."), TranslateT("Stranger"));
CallService(MS_MSG_SETSTATUSTEXT, (WPARAM)parent->GetChatHandle(), (LPARAM)&st);
}
@@ -566,7 +566,7 @@ bool Omegle_client::events()
st.cbSize = sizeof(st);
// st.hIcon = IcoLib_GetIconByHandle(GetIconHandle("typing_off")); // TODO: typing icon
- mir_sntprintf(st.tszText, SIZEOF(st.tszText), TranslateT("%s stopped typing."), TranslateT("Stranger"));
+ mir_sntprintf(st.tszText, _countof(st.tszText), TranslateT("%s stopped typing."), TranslateT("Stranger"));
CallService(MS_MSG_SETSTATUSTEXT, (WPARAM)parent->GetChatHandle(), (LPARAM)&st);
}