Don't crash in strutils::trim() with empty strings

This commit is contained in:
Torsten Dreyer
2010-10-05 22:39:41 +02:00
parent ddf9e08069
commit 0994ffc195

View File

@@ -131,10 +131,9 @@ namespace simgear {
static string
do_strip( const string& s, int striptype )
{
// if (s.empty())
// return s;
string::size_type len = s.length();
if( len == 0 ) // empty string is trivial
return s;
string::size_type i = 0;
if (striptype != RIGHTSTRIP)
{