Make CUser::PrintLine() a little more readable and fix the return value

git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1464 726aef4b-f618-498e-8847-2d620e286838
This commit is contained in:
psychon
2009-03-31 09:18:04 +00:00
parent 9439291e2d
commit 14ff7a85f6
+6 -2
View File
@@ -581,8 +581,12 @@ bool CUser::PrintLine(CFile& File, const CString& sName, const CString& sValue)
return false;
}
return File.Write("\t" + sName.FirstLine()
+ " = " + sValue.FirstLine() + "\n");
// FirstLine() so that no one can inject new lines to the config if he
// manages to add "\n" to e.g. sValue.
CString sLine = "\t" + sName.FirstLine() + " = " + sValue.FirstLine() + "\n";
if (File.Write(sLine) <= 0)
return false;
return true;
}
bool CUser::WriteConfig(CFile& File) {