mirror of
https://github.com/znc/znc.git
synced 2026-06-11 17:25:04 +02:00
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:
+2
-2
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user