summaryrefslogtreecommitdiff
path: root/plugins/Scriver/src/msgwindow.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2014-12-02 20:19:18 +0000
committerGeorge Hazan <george.hazan@gmail.com>2014-12-02 20:19:18 +0000
commitaeae01dc50a5adea8fe003c8195540b1f2b2169f (patch)
tree2c8f055fc562f9365e00577147fefb1a609b51c8 /plugins/Scriver/src/msgwindow.cpp
parent7cc46e2ce850957887aa75146585bca56b10695d (diff)
more transparent implementation of AppendToBuffer
git-svn-id: http://svn.miranda-ng.org/main/trunk@11222 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/Scriver/src/msgwindow.cpp')
-rw-r--r--plugins/Scriver/src/msgwindow.cpp15
1 files changed, 7 insertions, 8 deletions
diff --git a/plugins/Scriver/src/msgwindow.cpp b/plugins/Scriver/src/msgwindow.cpp
index 1504e4a8e5..bec26597d2 100644
--- a/plugins/Scriver/src/msgwindow.cpp
+++ b/plugins/Scriver/src/msgwindow.cpp
@@ -39,14 +39,11 @@ static const TCHAR *titleTokenNames[] = {_T("%name%"), _T("%status%"), _T("%stat
TCHAR* GetWindowTitle(MCONTACT hContact, const char *szProto)
{
- int isTemplate;
- int i, j;
TCHAR* tokens[4] = { 0 };
size_t tokenLen[4] = { 0 };
TCHAR *p, *tmplt, *title;
- char *accModule;
TCHAR *pszNewTitleEnd = mir_tstrdup(TranslateT("Message Session"));
- isTemplate = 0;
+ int isTemplate = 0;
if (hContact && szProto) {
tokens[0] = GetNickname(hContact, szProto);
tokenLen[0] = mir_tstrlen(tokens[0]);
@@ -55,7 +52,8 @@ TCHAR* GetWindowTitle(MCONTACT hContact, const char *szProto)
tokens[2] = db_get_tsa(hContact, "CList", "StatusMsg");
if (tokens[2] != NULL) {
tokenLen[2] = mir_tstrlen(tokens[2]);
- for (i = j = 0; i < tokenLen[2]; i++) {
+ size_t j = 0;
+ for (size_t i = 0; i < tokenLen[2]; i++) {
if (tokens[2][i] == '\r')
continue;
if (tokens[2][i] == '\n')
@@ -67,7 +65,7 @@ TCHAR* GetWindowTitle(MCONTACT hContact, const char *szProto)
tokenLen[2] = j;
}
- accModule = (char*)CallService(MS_PROTO_GETCONTACTBASEACCOUNT, hContact, 0);
+ char *accModule = (char*)CallService(MS_PROTO_GETCONTACTBASEACCOUNT, hContact, 0);
if (accModule != NULL) {
PROTOACCOUNT* proto = (PROTOACCOUNT*)CallService(MS_PROTO_GETACCOUNT, 0, (LPARAM)accModule);
if (proto != NULL) {
@@ -87,7 +85,7 @@ TCHAR* GetWindowTitle(MCONTACT hContact, const char *szProto)
}
else tmplt = _T("");
- size_t len;
+ size_t i, len;
for (len = 0, p = tmplt; *p; p++, len++) {
if (*p == '%') {
for (i = 0; i < SIZEOF(titleTokenNames); i++) {
@@ -117,7 +115,8 @@ TCHAR* GetWindowTitle(MCONTACT hContact, const char *szProto)
break;
}
}
- if (i < SIZEOF(titleTokenNames)) continue;
+ if (i < SIZEOF(titleTokenNames))
+ continue;
}
title[len++] = *p;
}