summaryrefslogtreecommitdiff
path: root/src/modules/chat/log.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2014-03-14 20:22:55 +0000
committerGeorge Hazan <george.hazan@gmail.com>2014-03-14 20:22:55 +0000
commit60adc0705ec417756a3e86d436ad21b5265a1da2 (patch)
tree112f226275020791c6d390d8413c517f96ef085c /src/modules/chat/log.cpp
parent6c11adb0b8ca512ffa8a2604ab2f7226a2214cc9 (diff)
fixes #592 (Crash on exit if LoadDefaultModules(void) not executed all)
git-svn-id: http://svn.miranda-ng.org/main/trunk@8604 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'src/modules/chat/log.cpp')
-rw-r--r--src/modules/chat/log.cpp40
1 files changed, 20 insertions, 20 deletions
diff --git a/src/modules/chat/log.cpp b/src/modules/chat/log.cpp
index 3a6ef5d0ac..c0d96658c9 100644
--- a/src/modules/chat/log.cpp
+++ b/src/modules/chat/log.cpp
@@ -107,7 +107,7 @@ static void Log_Append(char **buffer, int *cbBufferEnd, int *cbBufferAlloced, co
static int Log_AppendRTF(LOGSTREAMDATA* streamData, BOOL simpleMode, char **buffer, int *cbBufferEnd, int *cbBufferAlloced, const TCHAR *fmt, ...)
{
va_list va;
- int lineLen, textCharsCount=0;
+ int lineLen, textCharsCount = 0;
TCHAR* line = (TCHAR*)alloca(8001 * sizeof(TCHAR));
char* d;
@@ -117,10 +117,10 @@ static int Log_AppendRTF(LOGSTREAMDATA* streamData, BOOL simpleMode, char **buff
line[lineLen] = 0;
va_end(va);
- lineLen = lineLen*20 + 8;
+ lineLen = lineLen * 20 + 8;
if (*cbBufferEnd + lineLen > *cbBufferAlloced) {
cbBufferAlloced[0] += (lineLen + 1024 - lineLen % 1024);
- *buffer = (char *) mir_realloc(*buffer, *cbBufferAlloced);
+ *buffer = (char *)mir_realloc(*buffer, *cbBufferAlloced);
}
d = *buffer + *cbBufferEnd;
@@ -135,11 +135,11 @@ static int Log_AppendRTF(LOGSTREAMDATA* streamData, BOOL simpleMode, char **buff
CopyMemory(d, "\\line ", 6);
d += 6;
}
- else if (*line == '%' && !simpleMode ) {
+ else if (*line == '%' && !simpleMode) {
char szTemp[200];
szTemp[0] = '\0';
- switch ( *++line ) {
+ switch (*++line) {
case '\0':
case '%':
*d++ = '%';
@@ -150,7 +150,7 @@ static int Log_AppendRTF(LOGSTREAMDATA* streamData, BOOL simpleMode, char **buff
if (g_Settings->bStripFormat || streamData->bStripFormat)
line += 2;
- else if ( line[1] != '\0' && line[2] != '\0') {
+ else if (line[1] != '\0' && line[2] != '\0') {
TCHAR szTemp3[3], c = *line;
int col;
szTemp3[0] = line[1];
@@ -160,15 +160,15 @@ static int Log_AppendRTF(LOGSTREAMDATA* streamData, BOOL simpleMode, char **buff
col = _ttoi(szTemp3);
col += (OPTIONS_FONTCOUNT + 1);
- mir_snprintf(szTemp, SIZEOF(szTemp), ( c == 'c' ) ? "\\cf%u " : "\\highlight%u ", col);
+ mir_snprintf(szTemp, SIZEOF(szTemp), (c == 'c') ? "\\cf%u " : "\\highlight%u ", col);
}
break;
case 'C':
case 'F':
if (!g_Settings->bStripFormat && !streamData->bStripFormat) {
int j = streamData->lin->bIsHighlighted ? 16 : EventToIndex(streamData->lin);
- if ( *line == 'C' )
- mir_snprintf(szTemp, SIZEOF(szTemp), "\\cf%u ", j+1);
+ if (*line == 'C')
+ mir_snprintf(szTemp, SIZEOF(szTemp), "\\cf%u ", j + 1);
else
mir_snprintf(szTemp, SIZEOF(szTemp), "\\highlight0 ");
}
@@ -176,30 +176,30 @@ static int Log_AppendRTF(LOGSTREAMDATA* streamData, BOOL simpleMode, char **buff
case 'b':
case 'u':
case 'i':
- if (!streamData->bStripFormat )
- mir_snprintf(szTemp, SIZEOF(szTemp), (*line == 'u') ? "\\%cl " : "\\%c ", *line );
+ if (!streamData->bStripFormat)
+ mir_snprintf(szTemp, SIZEOF(szTemp), (*line == 'u') ? "\\%cl " : "\\%c ", *line);
break;
case 'B':
case 'U':
case 'I':
- if (!streamData->bStripFormat ) {
- mir_snprintf( szTemp, SIZEOF(szTemp), (*line == 'U') ? "\\%cl0 " : "\\%c0 ", *line );
- CharLowerA( szTemp );
+ if (!streamData->bStripFormat) {
+ mir_snprintf(szTemp, SIZEOF(szTemp), (*line == 'U') ? "\\%cl0 " : "\\%c0 ", *line);
+ CharLowerA(szTemp);
}
break;
case 'r':
- if (!streamData->bStripFormat ) {
+ if (!streamData->bStripFormat) {
int index = EventToIndex(streamData->lin);
mir_snprintf(szTemp, SIZEOF(szTemp), "%s ", Log_SetStyle(index));
}
break;
}
- if ( szTemp[0] ) {
+ if (szTemp[0]) {
int iLen = lstrlenA(szTemp);
- memcpy( d, szTemp, iLen );
+ memcpy(d, szTemp, iLen);
d += iLen;
}
}
@@ -209,15 +209,15 @@ static int Log_AppendRTF(LOGSTREAMDATA* streamData, BOOL simpleMode, char **buff
}
else if ((*line == '\\' || *line == '{' || *line == '}') && !streamData->bStripFormat) {
*d++ = '\\';
- *d++ = (char) *line;
+ *d++ = (char)*line;
}
else if (*line > 0 && *line < 128) {
- *d++ = (char) *line;
+ *d++ = (char)*line;
}
else d += sprintf(d, "\\u%u ?", (WORD)*line); //!!!!!!!!!!!
}
- *cbBufferEnd = (int) (d - *buffer);
+ *cbBufferEnd = (int)(d - *buffer);
return textCharsCount;
}