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 /protocols/Twitter/src/oauth.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 'protocols/Twitter/src/oauth.cpp')
-rw-r--r-- | protocols/Twitter/src/oauth.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/protocols/Twitter/src/oauth.cpp b/protocols/Twitter/src/oauth.cpp index b2d8aa4795..563e5fcbc5 100644 --- a/protocols/Twitter/src/oauth.cpp +++ b/protocols/Twitter/src/oauth.cpp @@ -90,7 +90,7 @@ wstring mir_twitter::UrlGetQuery(const wstring& url) wchar_t buf[1024*4] = {};
components.lpszExtraInfo = buf;
- components.dwExtraInfoLength = SIZEOF(buf);
+ components.dwExtraInfoLength = _countof(buf);
BOOL crackUrlOk = InternetCrackUrl(url.c_str(), url.size(), 0, &components);
_ASSERTE(crackUrlOk);
@@ -308,7 +308,7 @@ wstring mir_twitter::OAuthNormalizeUrl(const wstring& url) if (Compare(brokenURL[L"scheme"], L"http", false) && !(Compare(brokenURL[L"port"], L"80", false)) ||
(Compare(brokenURL[L"scheme"], L"https", false) && !(Compare(brokenURL[L"port"], L"443", false))))
{
- mir_snwprintf(port, SIZEOF(port), L":%s", brokenURL[L"port"]);
+ mir_snwprintf(port, _countof(port), L":%s", brokenURL[L"port"]);
}
// InternetCrackUrl includes ? and # elements in the path,
@@ -366,7 +366,7 @@ wstring mir_twitter::OAuthCreateNonce() wstring nonce;
for (int i = 0; i <= 16; ++i)
- nonce += ALPHANUMERIC[rand() % (SIZEOF(ALPHANUMERIC) - 1)]; // don't count null terminator in array
+ nonce += ALPHANUMERIC[rand() % (_countof(ALPHANUMERIC) - 1)]; // don't count null terminator in array
return nonce;
}
@@ -378,7 +378,7 @@ wstring mir_twitter::OAuthCreateTimestamp() _ASSERTE(utcNow != -1);
wchar_t buf[100] = {};
- mir_snwprintf(buf, SIZEOF(buf), L"%I64u", utcNow);
+ mir_snwprintf(buf, _countof(buf), L"%I64u", utcNow);
return buf;
}
|