From d1bb1b375d657f0821ccfebf18fa1c3873314690 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Wed, 5 Sep 2012 15:55:55 +0300 Subject: Fix useless variables initialisations. --- src/client.cpp | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'src/client.cpp') diff --git a/src/client.cpp b/src/client.cpp index 43d5650bb..7afe24cb2 100644 --- a/src/client.cpp +++ b/src/client.cpp @@ -1732,11 +1732,10 @@ void Client::initServerConfig(std::string serverName) logger->error(strprintf(_("%s doesn't exist and can't be created! " "Exiting."), mServerConfigDir.c_str())); } - FILE *configFile = nullptr; std::string configPath; configPath = mServerConfigDir + "/config.xml"; - configFile = fopen(configPath.c_str(), "r"); + FILE *configFile = fopen(configPath.c_str(), "r"); if (!configFile) { configFile = fopen(configPath.c_str(), "wt"); @@ -1803,7 +1802,6 @@ void Client::initConfiguration() const // Checking if the configuration file exists... otherwise create it with // default options. - FILE *configFile = nullptr; std::string configPath; // bool oldConfig = false; // int emptySize = config.getSize(); @@ -1813,7 +1811,7 @@ void Client::initConfiguration() const else configPath = mConfigDir + "/test.xml"; - configFile = fopen(configPath.c_str(), "r"); + FILE *configFile = fopen(configPath.c_str(), "r"); // If we can't read it, it doesn't exist ! if (!configFile) @@ -1995,9 +1993,7 @@ void Client::accountLogin(LoginData *const data) const bool Client::copyFile(const std::string &configPath, const std::string &oldConfigPath) const { - FILE *configFile = nullptr; - - configFile = fopen(oldConfigPath.c_str(), "r"); + FILE *configFile = fopen(oldConfigPath.c_str(), "r"); if (configFile) { -- cgit v1.2.3-70-g09d2