diff --git a/src/framework/configmanager.cpp b/src/framework/configmanager.cpp index 818a6b3a..e3494357 100644 --- a/src/framework/configmanager.cpp +++ b/src/framework/configmanager.cpp @@ -58,12 +58,11 @@ bool ConfigManager::load(const std::string& fileName) YAML::Node doc; parser.GetNextDocument(doc); - for(YAML::Iterator it = doc.begin(); it != doc.end(); it++) { + for(YAML::Iterator it = doc.begin(); it != doc.end(); ++it) { std::string key, value; it.first() >> key; it.second() >> value; m_confsMap[key] = value; - dump() << key << value; } } catch (YAML::ParserException& e) { error("Malformed configuration file!"); diff --git a/src/framework/resourcemanager.cpp b/src/framework/resourcemanager.cpp index 356fc93f..b6ba46b4 100644 --- a/src/framework/resourcemanager.cpp +++ b/src/framework/resourcemanager.cpp @@ -81,8 +81,9 @@ unsigned char *ResourceManager::loadFile(const std::string& fileName, unsigned i } *fileSize = PHYSFS_fileLength(file); - unsigned char *buffer = new unsigned char[*fileSize]; + unsigned char *buffer = new unsigned char[*fileSize + 1]; PHYSFS_read(file, (void*)buffer, 1, *fileSize); + buffer[*fileSize] = 0; PHYSFS_close(file); return buffer; }