mirror of
https://github.com/catchorg/Catch2.git
synced 2025-08-01 12:55:40 +02:00
Fixed trim() for single char strings (github #75)
This commit is contained in:
@@ -16,7 +16,7 @@
|
||||
|
||||
#ifdef CATCH_PLATFORM_WINDOWS
|
||||
|
||||
#include "windows.h"
|
||||
#include <windows.h>
|
||||
|
||||
namespace Catch
|
||||
{
|
||||
|
@@ -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 ) : "";
|
||||
}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user