From afc1b562fdca819b1c24b0efc094f256bd45267a Mon Sep 17 00:00:00 2001 From: MikalaiR Date: Thu, 21 Apr 2016 18:38:42 +0000 Subject: IEView: minor cleanup git-svn-id: http://svn.miranda-ng.org/main/trunk@16734 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/IEView/src/TemplateHTMLBuilder.cpp | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) (limited to 'plugins/IEView/src/TemplateHTMLBuilder.cpp') 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); -- cgit v1.2.3