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

summaryrefslogtreecommitdiffhomepage
path: root/src/catch2/internal
diff options
context:
space:
mode:
authorMark Jansen2024-09-05 23:06:32 +0200
committerMartin Hořeňovský2024-09-13 15:32:49 +0200
commit02d3304782c715cb787e53a20f4e44ec249d3466 (patch)
tree54ffc1097954d24da7f8ea3904e251b16af036b3 /src/catch2/internal
parent77eca4e8196a1afb12656aabb41569df70ab23e8 (diff)
downloadcatch3-02d3304782c715cb787e53a20f4e44ec249d3466.tar.gz
Fix bug in TokenStream parser
When presented with just '-' it would access the string at position [1]
Diffstat (limited to 'src/catch2/internal')
-rw-r--r--src/catch2/internal/catch_clara.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/catch2/internal/catch_clara.cpp b/src/catch2/internal/catch_clara.cpp
index c76089ee..f9dd9138 100644
--- a/src/catch2/internal/catch_clara.cpp
+++ b/src/catch2/internal/catch_clara.cpp
@@ -76,7 +76,7 @@ namespace Catch {
{ TokenType::Argument,
next.substr( delimiterPos + 1, next.size() ) } );
} else {
- if ( next[1] != '-' && next.size() > 2 ) {
+ if ( next.size() > 1 && next[1] != '-' && next.size() > 2 ) {
// Combined short args, e.g. "-ab" for "-a -b"
for ( size_t i = 1; i < next.size(); ++i ) {
m_tokenBuffer.push_back(