From 0bc6905beb27cee9e288e6680e4ce6a85bcfd8e8 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Wed, 15 Nov 2017 13:41:50 +0300 Subject: IRC: more code cleaning --- protocols/IRCG/src/tools.cpp | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'protocols/IRCG/src/tools.cpp') diff --git a/protocols/IRCG/src/tools.cpp b/protocols/IRCG/src/tools.cpp index a174921927..96434c7150 100644 --- a/protocols/IRCG/src/tools.cpp +++ b/protocols/IRCG/src/tools.cpp @@ -58,11 +58,11 @@ CMStringW __stdcall GetWord(const wchar_t* text, int index) while (*p1 == ' ') p1++; - if (*p1 != '\0') { + if (*p1 != 0) { for (int i = 0; i < index; i++) { p2 = wcschr(p1, ' '); if (!p2) - p2 = wcschr(p1, '\0'); + p2 = wcschr(p1, 0); else while (*p2 == ' ') p2++; @@ -72,7 +72,7 @@ CMStringW __stdcall GetWord(const wchar_t* text, int index) p2 = wcschr(p1, ' '); if (!p2) - p2 = wcschr(p1, '\0'); + p2 = wcschr(p1, 0); if (p1 != p2) return CMStringW(p1, p2 - p1); @@ -98,7 +98,7 @@ const wchar_t* __stdcall GetWordAddress(const wchar_t* text, int index) for (int i = 0; i < index; i++) { temp = wcschr(temp, ' '); if (!temp) - temp = (wchar_t*)wcschr(text, '\0'); + temp = (wchar_t*)wcschr(text, 0); else while (*temp == ' ') temp++; @@ -131,7 +131,7 @@ char* __stdcall IrcLoadFile(wchar_t* szPath) fseek(hFile, 0, SEEK_SET); // seek back to original pos szContainer = new char[dwSiz + 1]; fread(szContainer, 1, dwSiz, hFile); - szContainer[dwSiz] = '\0'; + szContainer[dwSiz] = 0; fclose(hFile); return szContainer; } @@ -191,11 +191,11 @@ CMStringA __stdcall GetWord(const char* text, int index) while (*p1 == ' ') p1++; - if (*p1 != '\0') { + if (*p1 != 0) { for (int i = 0; i < index; i++) { p2 = strchr(p1, ' '); if (!p2) - p2 = strchr(p1, '\0'); + p2 = strchr(p1, 0); else while (*p2 == ' ') p2++; @@ -205,7 +205,7 @@ CMStringA __stdcall GetWord(const char* text, int index) p2 = strchr(p1, ' '); if (!p2) - p2 = strchr(p1, '\0'); + p2 = strchr(p1, 0); if (p1 != p2) return CMStringA(p1, p2 - p1 + 1); @@ -254,7 +254,7 @@ static const wchar_t* DoEnterNumber(const wchar_t *text, int &res) wchar_t* __stdcall DoColorCodes(const wchar_t *text, bool bStrip, bool bReplacePercent) { - static wchar_t szTemp[4000]; szTemp[0] = '\0'; + static wchar_t szTemp[4000]; szTemp[0] = 0; wchar_t* p = szTemp; bool bBold = false; bool bUnderline = false; @@ -264,7 +264,7 @@ wchar_t* __stdcall DoColorCodes(const wchar_t *text, bool bStrip, bool bReplaceP if (!text) return szTemp; - while (*text != '\0') { + while (*text != 0) { switch (*text) { case '%': // escape *p++ = '%'; @@ -354,7 +354,7 @@ wchar_t* __stdcall DoColorCodes(const wchar_t *text, bool bStrip, bool bReplaceP } } - *p = '\0'; + *p = 0; return szTemp; } -- cgit v1.2.3