Don't write unexpected newlines to znc.conf

This patch fixes the same bug as the last commit and also makes sure that
similar bugs can't happen again.

Thanks to cnu for finding and reporting this bug.
Thanks to kroimon for patch review.


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1396 726aef4b-f618-498e-8847-2d620e286838
This commit is contained in:
psychon
2009-02-24 16:02:35 +00:00
parent 21120e2146
commit 3188856a86
4 changed files with 28 additions and 17 deletions

View File

@@ -554,11 +554,12 @@ bool CUser::PrintLine(CFile& File, const CString& sName, const CString& sValue)
return false;
}
return File.Write("\t" + sName + " = " + sValue + "\n");
return File.Write("\t" + sName.FirstLine()
+ " = " + sValue.FirstLine() + "\n");
}
bool CUser::WriteConfig(CFile& File) {
File.Write("<User " + GetUserName() + ">\n");
File.Write("<User " + GetUserName().FirstLine() + ">\n");
if (IsPassHashed()) {
if (m_sPassSalt.empty()) {