Fixed trim() for single char strings (github #75)

This commit is contained in:
Phil Nash
2012-02-28 20:04:25 +00:00
parent 97668c76f1
commit af8d0b3955
5 changed files with 26 additions and 3 deletions

View File

@@ -16,7 +16,7 @@
#ifdef CATCH_PLATFORM_WINDOWS
#include "windows.h"
#include <windows.h>
namespace Catch
{

View File

@@ -136,7 +136,7 @@ namespace Catch
std::string::size_type start = str.find_first_not_of( "\n\r\t " );
std::string::size_type end = str.find_last_not_of( "\n\r\t " );
return start < end ? str.substr( start, 1+end-start ) : "";
return start != std::string::npos ? str.substr( start, 1+end-start ) : "";
}