summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2017-03-08 01:20:31 +0300
committerAndrei Karas <akaras@inbox.ru>2017-03-08 02:14:42 +0300
commite6d078dd852f0d2cbaf04a258e4f3afa00e43234 (patch)
tree3c0724f696a4b34b3dda87ec3f2f3c7fe654c3f6 /src
parenteec1a3ac6695351acf0abe67a535e44883738a93 (diff)
downloadmanaplus-e6d078dd852f0d2cbaf04a258e4f3afa00e43234.tar.gz
manaplus-e6d078dd852f0d2cbaf04a258e4f3afa00e43234.tar.bz2
manaplus-e6d078dd852f0d2cbaf04a258e4f3afa00e43234.tar.xz
manaplus-e6d078dd852f0d2cbaf04a258e4f3afa00e43234.zip
Fix assert in creation default main configuration file.
Diffstat (limited to 'src')
-rw-r--r--src/configmanager.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/configmanager.cpp b/src/configmanager.cpp
index f95d98f4e..8f0ec3002 100644
--- a/src/configmanager.cpp
+++ b/src/configmanager.cpp
@@ -142,8 +142,14 @@ void ConfigManager::initConfiguration()
FILE *configFile = fopen(configPath.c_str(), "r");
if (!configFile)
{
- configFile = fopen(configPath.c_str(), "wt");
+ configFile = fopen(configPath.c_str(), "wb");
logger->log1("Creating new config");
+ if (configFile)
+ {
+ fputs("<?xml version=\"1.0\"?>\n", configFile);
+ fputs("<configuration>\n", configFile);
+ fputs("</configuration>\n", configFile);
+ }
}
if (!configFile)
{