diff --git a/engine/server/application/CentralServer/src/shared/ConsoleCommandParserGame.cpp b/engine/server/application/CentralServer/src/shared/ConsoleCommandParserGame.cpp index 3231ecff..0956464d 100644 --- a/engine/server/application/CentralServer/src/shared/ConsoleCommandParserGame.cpp +++ b/engine/server/application/CentralServer/src/shared/ConsoleCommandParserGame.cpp @@ -79,7 +79,7 @@ bool ConsoleCommandParserGame::performParsing(const NetworkId & track, const Str if(argv.size() > 2) { unsigned int pid; - sscanf(Unicode::wideToNarrow(argv[2]).c_str(), "%d", &pid); + sscanf(Unicode::wideToNarrow(argv[2]).c_str(), "%u", &pid); GameServerConnection * gameConn = CentralServer::getInstance().getGameServer(pid); if(gameConn) { diff --git a/engine/shared/library/sharedDebug/src/shared/Profiler.cpp b/engine/shared/library/sharedDebug/src/shared/Profiler.cpp index a0bd3089..7df643f3 100644 --- a/engine/shared/library/sharedDebug/src/shared/Profiler.cpp +++ b/engine/shared/library/sharedDebug/src/shared/Profiler.cpp @@ -217,8 +217,8 @@ bool VisibleExpandableEntry::pruneInvisibleChildren() for (Children::iterator i = m_children.begin(); i != m_children.end(); ) if ((*i)->m_visible == false) { - delete *i; m_children.erase(i); + delete *i; } else ++i; diff --git a/engine/shared/library/sharedFile/src/shared/FileManifest.cpp b/engine/shared/library/sharedFile/src/shared/FileManifest.cpp index 3a849751..c29c39de 100644 --- a/engine/shared/library/sharedFile/src/shared/FileManifest.cpp +++ b/engine/shared/library/sharedFile/src/shared/FileManifest.cpp @@ -278,9 +278,9 @@ void FileManifest::addNewManifestEntry(const char *fileName, int fileSize) if (fileSize) ((insertReturn.first)->second)->size = fileSize; - // delete the new entry we created - delete entry; } + + delete entry; #else return; #endif @@ -299,9 +299,7 @@ void FileManifest::addStoredManifestEntry(const char *fileName, const char * sce std::pair insertReturn = s_manifest.insert(std::pair(crc, entry)); - // if the insert failed, delete the entry we created - if (!insertReturn.second) - delete entry; + delete entry; } // ----------------------------------------------------------------------- diff --git a/engine/shared/library/sharedImage/src/shared/TargaFormat.cpp b/engine/shared/library/sharedImage/src/shared/TargaFormat.cpp index e85772d5..d6970c0a 100644 --- a/engine/shared/library/sharedImage/src/shared/TargaFormat.cpp +++ b/engine/shared/library/sharedImage/src/shared/TargaFormat.cpp @@ -1167,7 +1167,7 @@ bool TargaFormat::saveImage(const Image &image, const char *filename) //--------------------------------------------------- f = fopen(filename, "wb"); - if (!f) + if (f==NULL) { DEBUG_WARNING(true, ("Unable to open Targa destination file %s.\n", filename)); return false; diff --git a/engine/shared/library/sharedMath/src/shared/PaletteArgb.cpp b/engine/shared/library/sharedMath/src/shared/PaletteArgb.cpp index 097826be..c00fe80e 100644 --- a/engine/shared/library/sharedMath/src/shared/PaletteArgb.cpp +++ b/engine/shared/library/sharedMath/src/shared/PaletteArgb.cpp @@ -253,7 +253,7 @@ bool PaletteArgb::write(const char *pathName) const // open file FILE *const file = fopen(pathName, "wb"); - if (!file) + if (file==NULL) { WARNING(true, ("failed to open file [%s] for writing.", pathName)); return false; diff --git a/engine/shared/library/sharedNetwork/src/linux/NetworkGetHostName.cpp b/engine/shared/library/sharedNetwork/src/linux/NetworkGetHostName.cpp index a68bba8d..5d210dbd 100644 --- a/engine/shared/library/sharedNetwork/src/linux/NetworkGetHostName.cpp +++ b/engine/shared/library/sharedNetwork/src/linux/NetworkGetHostName.cpp @@ -96,7 +96,7 @@ addrList() if (errno != EINVAL || lastReqSize != 0) { WARNING(true, ("Error getting interface list: %s", strerror(errno))); - delete buf; + delete [] buf; return; } } diff --git a/external/3rd/library/soePlatform/CSAssist/projects/CSAssist/CSAssistgameapi/CSAssistgameapicore.cpp b/external/3rd/library/soePlatform/CSAssist/projects/CSAssist/CSAssistgameapi/CSAssistgameapicore.cpp index 6d486c33..a09de08a 100644 --- a/external/3rd/library/soePlatform/CSAssist/projects/CSAssist/CSAssistgameapi/CSAssistgameapicore.cpp +++ b/external/3rd/library/soePlatform/CSAssist/projects/CSAssist/CSAssistgameapi/CSAssistgameapicore.cpp @@ -151,10 +151,10 @@ CSAssistGameAPIcore::CSAssistGameAPIcore(CSAssistGameAPI *api, const char *serve m_serverList.push_back(sid); } //fprintf(stderr, "res=%d, p=%s, host=%s, port=%d, size=%d\n", res, p, host, port, m_serverList.size()); - delete p; + delete [] p; } - delete host; - delete buf; + delete [] host; + delete [] buf; m_curServer = m_serverList.begin(); GetLBHost(); //