diff options
author | TatWai Chong <tatwai.chong@arm.com> | 2023-11-02 00:52:57 -0700 |
---|---|---|
committer | Eric Kunze <eric.kunze@arm.com> | 2023-11-10 16:35:01 +0000 |
commit | 851497a73fa5bb9cfef034b71f5b4af837fd29c0 (patch) | |
tree | a34346a9a4c7af5b77535572ec1d945ea2a62a3b | |
parent | a4d907e8686791dd84ed987d0d79325c4d908b73 (diff) | |
download | reference_model-851497a73fa5bb9cfef034b71f5b4af837fd29c0.tar.gz |
[fix] Fix the parsing failure during splitting multiple files to the argument
The second parameter of std::string::substr holds the number of
characters to include in the substring, rather than the index of
the end of the capture.
Change-Id: Ie8c36efcb1850fcc1f44d430569f18646f6bfd45
Signed-off-by: TatWai Chong <tatwai.chong@arm.com>
-rw-r--r-- | reference_model/src/main.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/reference_model/src/main.cpp b/reference_model/src/main.cpp index 6d50f9e..6970bb1 100644 --- a/reference_model/src/main.cpp +++ b/reference_model/src/main.cpp @@ -557,7 +557,9 @@ std::vector<std::string> parseFromString(std::string raw_str) if (end == std::string::npos) last_pair = true; - name = raw_str.substr(start, end); + // The second parameter holds for number of characters to include in the substring, + // not for the index of the end of the capture. + name = raw_str.substr(start, end - start); result.push_back(name); |