summaryrefslogtreecommitdiff
path: root/plugins/IEView/src/TemplateHTMLBuilder.cpp
diff options
context:
space:
mode:
authorMikalaiR <nikolay.romanovich@narod.ru>2016-04-21 18:38:42 +0000
committerMikalaiR <nikolay.romanovich@narod.ru>2016-04-21 18:38:42 +0000
commitafc1b562fdca819b1c24b0efc094f256bd45267a (patch)
treeca76bcc8ae97bd607f74988c6d65a96836612752 /plugins/IEView/src/TemplateHTMLBuilder.cpp
parent6f03a0bf158226db5e50e099786a09ba4894a393 (diff)
IEView: minor cleanup
git-svn-id: http://svn.miranda-ng.org/main/trunk@16734 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/IEView/src/TemplateHTMLBuilder.cpp')
-rw-r--r--plugins/IEView/src/TemplateHTMLBuilder.cpp20
1 files changed, 12 insertions, 8 deletions
diff --git a/plugins/IEView/src/TemplateHTMLBuilder.cpp b/plugins/IEView/src/TemplateHTMLBuilder.cpp
index f61646820c..ad7271e9a8 100644
--- a/plugins/IEView/src/TemplateHTMLBuilder.cpp
+++ b/plugins/IEView/src/TemplateHTMLBuilder.cpp
@@ -24,8 +24,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
TemplateHTMLBuilder::TemplateHTMLBuilder()
{
iLastEventType = -1;
- startedTime = time(NULL);
- lastEventTime = time(NULL);
+ startedTime = lastEventTime = time(NULL);
groupTemplate = NULL;
}
@@ -114,7 +113,7 @@ void TemplateHTMLBuilder::buildHeadTemplate(IEView *view, IEVIEWEVENT *event, Pr
return;
DBVARIANT dbv;
- char tempBase[1024];
+
char tempStr[1024];
char *szNameIn = NULL;
char *szNameOut = NULL;
@@ -127,12 +126,13 @@ void TemplateHTMLBuilder::buildHeadTemplate(IEView *view, IEVIEWEVENT *event, Pr
MCONTACT hRealContact = getRealContact(event->hContact);
char *szRealProto = getProto(hRealContact);
char *szProto = getProto(event->pszProto, event->hContact);
- tempBase[0] = '\0';
TemplateMap *tmpm = getTemplateMap(protoSettings);
if (tmpm == NULL)
return;
+ char tempBase[1024] = { 0 };
+
mir_strcpy(tempBase, "file://");
mir_strncat(tempBase, tmpm->getFilename(), _countof(tempBase) - mir_strlen(tempBase));
char *pathrun = tempBase + mir_strlen(tempBase);
@@ -285,6 +285,7 @@ void TemplateHTMLBuilder::appendEventTemplate(IEView *view, IEVIEWEVENT *event,
char tempBase[1024];
char tempStr[1024];
char szCID[32];
+
char *szNameIn = NULL;
char *szNameOut = NULL;
char *szUIN = NULL;
@@ -306,10 +307,13 @@ void TemplateHTMLBuilder::appendEventTemplate(IEView *view, IEVIEWEVENT *event,
if (tmpm != NULL) {
mir_strcpy(tempBase, "file://");
mir_strcat(tempBase, tmpm->getFilename());
- char* pathrun = tempBase + mir_strlen(tempBase);
- while ((*pathrun != '\\' && *pathrun != '/') && (pathrun > tempBase)) pathrun--;
- pathrun++;
- *pathrun = '\0';
+
+ char* pathrun = nullptr;
+ if (pathrun = strrchr(tempBase, '\\'))
+ ++pathrun = '\0';
+ else if (pathrun = strrchr(tempBase, '/'))
+ ++pathrun = '\0';
+
isGrouping = tmpm->isGrouping();
}
char *szBase = mir_utf8encode(tempBase);