summaryrefslogtreecommitdiff
path: root/src/client.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2012-09-05 15:55:55 +0300
committerAndrei Karas <akaras@inbox.ru>2012-09-05 15:55:55 +0300
commitd1bb1b375d657f0821ccfebf18fa1c3873314690 (patch)
treeeb83bbf7242b2c367c4df19113f37f6c6ab9faa2 /src/client.cpp
parent9f87b4c92e3a4d524250dbbb376cd0f59b7d995e (diff)
downloadmanaverse-d1bb1b375d657f0821ccfebf18fa1c3873314690.tar.gz
manaverse-d1bb1b375d657f0821ccfebf18fa1c3873314690.tar.bz2
manaverse-d1bb1b375d657f0821ccfebf18fa1c3873314690.tar.xz
manaverse-d1bb1b375d657f0821ccfebf18fa1c3873314690.zip
Fix useless variables initialisations.
Diffstat (limited to 'src/client.cpp')
-rw-r--r--src/client.cpp10
1 files changed, 3 insertions, 7 deletions
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)
{