diff --git a/include/internal/catch_version.h b/include/internal/catch_version.h index 09032d68..9f6bc283 100644 --- a/include/internal/catch_version.h +++ b/include/internal/catch_version.h @@ -15,7 +15,7 @@ namespace Catch { Version( unsigned int _majorVersion, unsigned int _minorVersion, unsigned int _patchNumber, - std::string const& _branchName, + char const * const _branchName, unsigned int _buildNumber ); unsigned int const majorVersion; @@ -23,7 +23,7 @@ namespace Catch { unsigned int const patchNumber; // buildNumber is only used if branchName is not null - std::string const branchName; + char const * const branchName; unsigned int const buildNumber; friend std::ostream& operator << ( std::ostream& os, Version const& version ); diff --git a/include/internal/catch_version.hpp b/include/internal/catch_version.hpp index 2af86348..4ce90645 100644 --- a/include/internal/catch_version.hpp +++ b/include/internal/catch_version.hpp @@ -16,7 +16,7 @@ namespace Catch { ( unsigned int _majorVersion, unsigned int _minorVersion, unsigned int _patchNumber, - std::string const& _branchName, + char const * const _branchName, unsigned int _buildNumber ) : majorVersion( _majorVersion ), minorVersion( _minorVersion ), @@ -29,10 +29,10 @@ namespace Catch { os << version.majorVersion << '.' << version.minorVersion << '.' << version.patchNumber; - - if( !version.branchName.empty() ) { - os << '-' << version.branchName - << '.' << version.buildNumber; + // branchName is never null -> 0th char is \0 if it is empty + if (version.branchName[0]) { + os << '-' << version.branchName + << '.' << version.buildNumber; } return os; }