Fixed bug in RightTrim() and LeftTrim() for empty strings

git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@257 726aef4b-f618-498e-8847-2d620e286838
This commit is contained in:
prozacx
2005-05-10 21:40:00 +00:00
parent 1a9ffe7d86
commit 956f203b6e

View File

@@ -179,7 +179,7 @@ bool CString::Trim(const CString& s) {
bool CString::LeftTrim(const CString& s) {
bool bRet = false;
while (s.find(Left(1)) != CString::npos) {
while (length() && s.find(Left(1)) != CString::npos) {
LeftChomp();
bRet = true;
}
@@ -190,7 +190,7 @@ bool CString::LeftTrim(const CString& s) {
bool CString::RightTrim(const CString& s) {
bool bRet = false;
while (s.find(Right(1)) != CString::npos) {
while (length() && s.find(Right(1)) != CString::npos) {
RightChomp();
bRet = true;
}