Skip to content
Snippets Groups Projects
Commit ec4119b8 authored by Giovanni Bussi's avatar Giovanni Bussi
Browse files

Fixed bug

There was a potential bug when stripping blanks from short strings (1 char)
parent ffce9a07
No related branches found
No related tags found
No related merge requests found
......@@ -283,7 +283,7 @@ vector<string> Tools::ls(const string&d){
void Tools::stripLeadingAndTrailingBlanks( std::string& str ){
std::size_t first=str.find_first_not_of(' ');
std::size_t last=str.find_last_not_of(' ');
if( first<last ) str=str.substr(first,last+1);
if( first<=last && first!=std::string::npos) str=str.substr(first,last+1);
}
std::string Tools::extension(const std::string&s){
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment