summaryrefslogtreecommitdiff
path: root/src/client.cpp
diff options
context:
space:
mode:
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)
{