Update of /cvsroot/pclasses/pclasses2/src/Util
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9535
Modified Files:
StringTool.cpp
Log Message:
corrected potential segfault in the new trimRight() code.
Index: StringTool.cpp
===================================================================
RCS file: /cvsroot/pclasses/pclasses2/src/Util/StringTool.cpp,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -d -r1.10 -r1.11
--- StringTool.cpp 12 Mar 2005 14:54:50 -0000 1.10
+++ StringTool.cpp 12 Mar 2005 14:57:40 -0000 1.11
@@ -413,6 +413,7 @@
void trimRight(std::string& str)
{
std::string::size_type nw = str.find_last_not_of(" \t\n\r");
+ if( std::string::npos == nw ) return;
str.erase(nw+1);
}
|