summaryrefslogtreecommitdiff
path: root/protocols/GTalkExt/src
diff options
context:
space:
mode:
Diffstat (limited to 'protocols/GTalkExt/src')
-rw-r--r--protocols/GTalkExt/src/avatar.cpp13
-rw-r--r--protocols/GTalkExt/src/handlers.cpp2
-rw-r--r--protocols/GTalkExt/src/inbox.cpp6
-rw-r--r--protocols/GTalkExt/src/notifications.cpp4
4 files changed, 11 insertions, 14 deletions
diff --git a/protocols/GTalkExt/src/avatar.cpp b/protocols/GTalkExt/src/avatar.cpp
index 4f3e848c4b..433ac0db65 100644
--- a/protocols/GTalkExt/src/avatar.cpp
+++ b/protocols/GTalkExt/src/avatar.cpp
@@ -33,21 +33,18 @@
LPTSTR CreateAvaFile(HANDLE *hFile)
{
TCHAR name[MAX_PATH + 2];
- TCHAR path[MAX_PATH + 2];
- TCHAR full[MAX_PATH + 2];
-
if (CallService(MS_DB_GETPROFILENAMET, (WPARAM)SIZEOF(name), (LPARAM)&name))
return NULL;
- for (int i = mir_tstrlen(name); i >= 0; i--)
- if ('.' == name[i]) {
- name[i] = 0;
- break;
- }
+ TCHAR *p = _tcsrchr(name, '.');
+ if (p)
+ *p = 0;
+ TCHAR path[MAX_PATH + 2];
if (CallService(MS_DB_GETPROFILEPATHT, (WPARAM)SIZEOF(path), (LPARAM)&path))
return NULL;
+ TCHAR full[MAX_PATH + 2];
mir_sntprintf(full, SIZEOF(full), AVA_FILE_NAME_FORMAT, path, name);
CreateDirectoryTreeT(full);
diff --git a/protocols/GTalkExt/src/handlers.cpp b/protocols/GTalkExt/src/handlers.cpp
index 361c33463b..0bfbc8f980 100644
--- a/protocols/GTalkExt/src/handlers.cpp
+++ b/protocols/GTalkExt/src/handlers.cpp
@@ -45,7 +45,7 @@ GoogleTalkAcc* isGoogle(LPARAM lParam)
void FormatMessageUrl(LPCTSTR format, LPTSTR buf, LPCTSTR mailbox, LPCTSTR tid)
{
ULARGE_INTEGER iTid; iTid.QuadPart = _tstoi64(tid);
- int l = mir_tstrlen(buf);
+ size_t l = mir_tstrlen(buf);
mir_sntprintf(buf, l, format, mailbox, iTid.HighPart, iTid.LowPart);
assert(l >= mir_tstrlen(buf));
}
diff --git a/protocols/GTalkExt/src/inbox.cpp b/protocols/GTalkExt/src/inbox.cpp
index 6cf8958914..218c3d28bc 100644
--- a/protocols/GTalkExt/src/inbox.cpp
+++ b/protocols/GTalkExt/src/inbox.cpp
@@ -60,7 +60,7 @@ LPSTR HttpPost(HANDLE hUser, LPSTR reqUrl, LPSTR reqParams)
nlhr.headers = (NETLIBHTTPHEADER*)&HEADER_URL_ENCODED;
nlhr.headersCount = 1;
nlhr.pData = reqParams;
- nlhr.dataLength = mir_strlen(reqParams);
+ nlhr.dataLength = (int)mir_strlen(reqParams);
NETLIBHTTPREQUEST *pResp = (NETLIBHTTPREQUEST*)CallService(MS_NETLIB_HTTPTRANSACTION, (WPARAM)hUser, (LPARAM)&nlhr);
if (!pResp) return NULL;
@@ -177,8 +177,8 @@ BOOL OpenUrlWithAuth(LPCSTR acc, LPCTSTR mailbox, LPCTSTR url)
int pwdLen = GetMailboxPwd(acc, mailbox, NULL, 0);
if (!pwdLen++) return FALSE;
- int urlLen = mir_tstrlen(url) + 1;
- int mailboxLen = mir_tstrlen(mailbox) + 1;
+ size_t urlLen = mir_tstrlen(url) + 1;
+ size_t mailboxLen = mir_tstrlen(mailbox) + 1;
OPEN_URL_HEADER *data = (OPEN_URL_HEADER*)malloc(sizeof(OPEN_URL_HEADER) + urlLen + mailboxLen + pwdLen);
data->url = (LPSTR)data + sizeof(OPEN_URL_HEADER);
diff --git a/protocols/GTalkExt/src/notifications.cpp b/protocols/GTalkExt/src/notifications.cpp
index ebd601737d..0cdbc1e3b4 100644
--- a/protocols/GTalkExt/src/notifications.cpp
+++ b/protocols/GTalkExt/src/notifications.cpp
@@ -231,8 +231,8 @@ void ShowNotification(LPCSTR acc, POPUPDATAT *data, LPCTSTR jid, LPCTSTR url, LP
}
data->PluginWindowProc = PopupProc;
- int lurl = (mir_tstrlen(url) + 1) * sizeof(TCHAR);
- int ljid = (mir_tstrlen(jid) + 1) * sizeof(TCHAR);
+ size_t lurl = (mir_tstrlen(url) + 1) * sizeof(TCHAR);
+ size_t ljid = (mir_tstrlen(jid) + 1) * sizeof(TCHAR);
POPUP_DATA_HEADER *ppdh = (POPUP_DATA_HEADER*)malloc(sizeof(POPUP_DATA_HEADER) + lurl + ljid);
ppdh->MarkRead = FALSE;