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/Yahoo/src/yahoo.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/Yahoo/src/yahoo.cpp')
-rw-r--r-- | protocols/Yahoo/src/yahoo.cpp | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/protocols/Yahoo/src/yahoo.cpp b/protocols/Yahoo/src/yahoo.cpp index 7e98c01909..1975b778be 100644 --- a/protocols/Yahoo/src/yahoo.cpp +++ b/protocols/Yahoo/src/yahoo.cpp @@ -519,7 +519,7 @@ void CYahooProto::ext_got_audible(const char *me, const char *who, const char *a }
char z[1028];
- mir_snprintf(z, SIZEOF(z), "[miranda-audible] %s", msg ? msg : "");
+ mir_snprintf(z, _countof(z), "[miranda-audible] %s", msg ? msg : "");
ext_got_im((char*)me, (char*)who, 0, z, 0, 0, 1, -1, NULL, 0);
}
@@ -733,7 +733,7 @@ void CYahooProto::ext_contact_added(const char *myid, const char *who, const cha nick[0] = '\0';
if (lname && fname)
- mir_snprintf(nick, SIZEOF(nick), "%s %s", fname, lname);
+ mir_snprintf(nick, _countof(nick), "%s %s", fname, lname);
else if (lname)
strncpy_s(nick, lname, _TRUNCATE);
else if (fname)
@@ -924,15 +924,15 @@ void CYahooProto::ext_mail_notify(const char *from, const char *subj, int cnt) TCHAR z[MAX_SECONDLINE], title[MAX_CONTACTNAME];
if (from == NULL) {
- mir_sntprintf(title, SIZEOF(title), _T("%s: %s"), m_tszUserName, TranslateT("New Mail"));
- mir_sntprintf(z, SIZEOF(z), TranslateT("You have %i unread messages"), cnt);
+ mir_sntprintf(title, _countof(title), _T("%s: %s"), m_tszUserName, TranslateT("New Mail"));
+ mir_sntprintf(z, _countof(z), TranslateT("You have %i unread messages"), cnt);
}
else {
- mir_sntprintf(title, SIZEOF(title), TranslateT("New Mail (%i messages)"), cnt);
+ mir_sntprintf(title, _countof(title), TranslateT("New Mail (%i messages)"), cnt);
ptrT tszFrom(mir_utf8decodeT(from));
ptrT tszSubj(mir_utf8decodeT(subj));
- mir_sntprintf(z, SIZEOF(z), TranslateT("From: %s\nSubject: %s"), (TCHAR*)tszFrom, (TCHAR*)tszSubj);
+ mir_sntprintf(z, _countof(z), TranslateT("From: %s\nSubject: %s"), (TCHAR*)tszFrom, (TCHAR*)tszSubj);
}
if (!ShowPopup(title, z, "http://mail.yahoo.com"))
@@ -984,7 +984,7 @@ void ext_yahoo_got_cookies(int id) //wsprintfA(z, "Cookie: %s; C=%s; Y=%s; T=%s", Bcookie, yahoo_get_cookie(id, "c"), yahoo_get_cookie(id, "y"), yahoo_get_cookie(id, "t"));
//wsprintfA(z, "Cookie: %s; Y=%s", Bcookie, yahoo_get_cookie(id, "y"), yahoo_get_cookie(id, "t"));
- mir_snprintf(z, SIZEOF(z), "Cookie: Y=%s; T=%s", yahoo_get_cookie(id, "y"), yahoo_get_cookie(id, "t"));
+ mir_snprintf(z, _countof(z), "Cookie: Y=%s; T=%s", yahoo_get_cookie(id, "y"), yahoo_get_cookie(id, "t"));
LOG(("Our Cookie: '%s'", z));
CallService(MS_NETLIB_SETSTICKYHEADERS, (WPARAM)hnuMain, (LPARAM)z);*/
@@ -993,7 +993,7 @@ void ext_yahoo_got_cookies(int id) char z[1024];
// need to add Cookie header to our requests or we get booted w/ "Bad Cookie" message.
- mir_snprintf(z, SIZEOF(z), "Cookie: Y=%s; T=%s; C=%s", yahoo_get_cookie(id, "y"),
+ mir_snprintf(z, _countof(z), "Cookie: Y=%s; T=%s; C=%s", yahoo_get_cookie(id, "y"),
yahoo_get_cookie(id, "t"), yahoo_get_cookie(id, "c"));
LOG(("Our Cookie: '%s'", z));
CallService(MS_NETLIB_SETSTICKYHEADERS, (WPARAM)hNetlibUser, (LPARAM)z);
@@ -1235,7 +1235,7 @@ void CYahooProto::ext_send_http_request(enum yahoo_connection_type type, const c if (nlhr.requestType == REQUEST_POST) {
httpHeaders[nlhr.headersCount].szName = "Content-Length";
- mir_snprintf(z, SIZEOF(z), "%d", content_length);
+ mir_snprintf(z, _countof(z), "%d", content_length);
httpHeaders[nlhr.headersCount].szValue = z;
nlhr.headersCount++;
@@ -1378,7 +1378,7 @@ char * CYahooProto::ext_send_https_request(struct yahoo_data *yd, const char *ho char z[4096], *result = NULL;
int i;
- mir_snprintf(z, SIZEOF(z), "https://%s%s", host, path);
+ mir_snprintf(z, _countof(z), "https://%s%s", host, path);
nlhr.cbSize = sizeof(nlhr);
nlhr.requestType = REQUEST_GET;
nlhr.flags = NLHRF_HTTP11 | NLHRF_NODUMPSEND | NLHRF_DUMPASTEXT; /* Use HTTP/1.1 and don't dump the requests to the log */
@@ -1451,7 +1451,7 @@ void CYahooProto::ext_login(enum yahoo_status login_mode) NETLIBHTTPREQUEST nlhr = { 0 }, *nlhrReply;
char z[4096];
- mir_snprintf(z, SIZEOF(z), "http://%s%s", getByte("YahooJapan", 0) != 0 ? "cs1.msg.vip.ogk.yahoo.co.jp" : "vcs.msg.yahoo.com", "/capacity");
+ mir_snprintf(z, _countof(z), "http://%s%s", getByte("YahooJapan", 0) != 0 ? "cs1.msg.vip.ogk.yahoo.co.jp" : "vcs.msg.yahoo.com", "/capacity");
nlhr.cbSize = sizeof(nlhr);
nlhr.requestType = REQUEST_GET;
nlhr.flags = NLHRF_HTTP11;
|