diff --git a/Config.cpp b/Config.cpp index d4cd8080..dfbc4520 100644 --- a/Config.cpp +++ b/Config.cpp @@ -170,22 +170,22 @@ bool CConfig::Parse(CFile& file, CString& sErrorMsg) return true; } -void CConfig::Write(CFile *pFile, unsigned int iIndentation) { +void CConfig::Write(CFile& File, unsigned int iIndentation) { CString sIndentation = CString(iIndentation, '\t'); for (EntryMapIterator it = m_ConfigEntries.begin(); it != m_ConfigEntries.end(); ++it) { for (VCString::const_iterator it2 = it->second.begin(); it2 != it->second.end(); ++it2) { - pFile->Write(sIndentation + it->first + " = " + *it2 + "\n"); + File.Write(sIndentation + it->first + " = " + *it2 + "\n"); } } for (SubConfigMapIterator it = m_SubConfigs.begin(); it != m_SubConfigs.end(); ++it) { for (SubConfig::const_iterator it2 = it->second.begin(); it2 != it->second.end(); ++it2) { - pFile->Write("\n"); + File.Write("\n"); - pFile->Write(sIndentation + "<" + it->first + " " + it2->first + ">\n"); - it2->second.m_pSubConfig->Write(pFile, iIndentation + 1); - pFile->Write(sIndentation + "first + ">\n"); + File.Write(sIndentation + "<" + it->first + " " + it2->first + ">\n"); + it2->second.m_pSubConfig->Write(File, iIndentation + 1); + File.Write(sIndentation + "first + ">\n"); } } } diff --git a/Config.h b/Config.h index 3c345ff5..eee074ed 100644 --- a/Config.h +++ b/Config.h @@ -134,7 +134,7 @@ public: } bool Parse(CFile& file, CString& sErrorMsg); - void Write(CFile *pFile, unsigned int iIndentation = 0); + void Write(CFile& file, unsigned int iIndentation = 0); private: EntryMap m_ConfigEntries; diff --git a/znc.cpp b/znc.cpp index 56d799c1..0f9662cf 100644 --- a/znc.cpp +++ b/znc.cpp @@ -499,7 +499,7 @@ bool CZNC::WriteConfig() { config.AddSubConfig("User", it->second->GetUserName(), it->second->ToConfig()); } - config.Write(pFile); + config.Write(*pFile); // If Sync() fails... well, let's hope nothing important breaks.. pFile->Sync();