Read-only mirrors. Development, issues and pull requests are on GitHub.

summaryrefslogtreecommitdiffhomepage
path: root/include
diff options
context:
space:
mode:
authorFraser Hutchison2013-10-24 02:53:13 +0100
committerFraser Hutchison2013-10-24 02:53:13 +0100
commit6253386458568cbe4d097ea59309a80ee2ffa815 (patch)
tree57cde16f95fe9668472ab9c7883e34151139b71a /include
parent93a945cee9d41236c91995f0bec563bcacbfc5c8 (diff)
downloadcatch3-6253386458568cbe4d097ea59309a80ee2ffa815.tar.gz
Fixes overflow issue when listing tests.
Diffstat (limited to 'include')
-rw-r--r--include/internal/catch_list.hpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/include/internal/catch_list.hpp b/include/internal/catch_list.hpp
index 550107f8..45807edd 100644
--- a/include/internal/catch_list.hpp
+++ b/include/internal/catch_list.hpp
@@ -86,12 +86,13 @@ namespace Catch {
std::cout << nameCol;
}
if( i < tagsWrapper.size() && !tagsWrapper[i].empty() ) {
+ size_t padLen( maxNameLen > nameCol.size() ? maxNameLen - nameCol.size() : 0 );
if( i == 0 ) {
Colour colourGuard( Colour::SecondaryText );
- std::cout << " " << std::string( maxNameLen - nameCol.size(), '.' ) << " ";
+ std::cout << " " << std::string( padLen, '.' ) << " ";
}
else {
- std::cout << std::string( maxNameLen - nameCol.size(), ' ' ) << " ";
+ std::cout << std::string( padLen, ' ' ) << " ";
}
std::cout << tagsWrapper[i];
}