From d8850660bcbec0677f4b550f716b9d2632e4d970 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Sat, 21 Sep 2013 16:26:45 +0000 Subject: - variables/fields names' conflict resolved; - members names standardization; - code cleaning; git-svn-id: http://svn.miranda-ng.org/main/trunk@6162 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- src/modules/netlib/netliblog.cpp | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) (limited to 'src/modules') diff --git a/src/modules/netlib/netliblog.cpp b/src/modules/netlib/netliblog.cpp index 857f5c75d0..0e121ef4fb 100644 --- a/src/modules/netlib/netliblog.cpp +++ b/src/modules/netlib/netliblog.cpp @@ -414,11 +414,8 @@ void NetlibLogf(NetlibUser* nlu, const char *fmt, ...) void NetlibDumpData(NetlibConnection *nlc, PBYTE buf, int len, int sent, int flags) { - int isText = 1; char szTitleLine[128]; char *szBuf; - int titleLineLen; - NetlibUser *nlu; bool useStack = false; // This section checks a number of conditions and aborts @@ -439,8 +436,8 @@ void NetlibDumpData(NetlibConnection *nlc, PBYTE buf, int len, int sent, int fla return; WaitForSingleObject(hConnectionHeaderMutex, INFINITE); - nlu = nlc ? nlc->nlu : NULL; - titleLineLen = mir_snprintf(szTitleLine, SIZEOF(szTitleLine), "(%p:%u) Data %s%s\r\n", + NetlibUser *nlu = nlc ? nlc->nlu : NULL; + int titleLineLen = mir_snprintf(szTitleLine, SIZEOF(szTitleLine), "(%p:%u) Data %s%s\r\n", nlc, nlc ? nlc->s : 0, sent ? "sent" : "received", flags & MSG_DUMPPROXY ? " (proxy)" : ""); ReleaseMutex(hConnectionHeaderMutex); @@ -452,18 +449,19 @@ void NetlibDumpData(NetlibConnection *nlc, PBYTE buf, int len, int sent, int fla else if ( !nlu->toLog) return; + bool isText = true; if ( !logOptions.textDumps) - isText = 0; + isText = false; else if ( !(flags & MSG_DUMPASTEXT)) { if (logOptions.autoDetectText) { for (int i=0; i < len; i++) { if ((buf[i] < ' ' && buf[i] != '\t' && buf[i] != '\r' && buf[i] != '\n') || buf[i] >= 0x80) { - isText = 0; + isText = false; break; } } } - else isText = 0; + else isText = false; } // Text data @@ -507,13 +505,13 @@ void NetlibDumpData(NetlibConnection *nlc, PBYTE buf, int len, int sent, int fla } for (col = 0; col < colsInLine; col++) - *pszBuf++=buf[line+col]<' '?'.':(char)buf[line+col]; + *pszBuf++ = (buf[line+col] < ' ') ? '.' : (char)buf[line+col]; if (len-line <= 16) break; - *pszBuf++='\r'; // End each line with a break - *pszBuf++='\n'; // End each line with a break + *pszBuf++ = '\r'; // End each line with a break + *pszBuf++ = '\n'; // End each line with a break } *pszBuf = '\0'; } -- cgit v1.2.3