aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTatWai Chong <tatwai.chong@arm.com>2023-11-02 00:52:57 -0700
committerEric Kunze <eric.kunze@arm.com>2023-11-29 05:11:08 +0000
commit614a911397f138eee6a108d802c0d5c7251a1897 (patch)
tree54779c3081c525d143d5f0d64b441dfc5b32fd0c
parent400f758d8a560ab8ea6ea4140a2267bd6f8017ac (diff)
downloadreference_model-614a911397f138eee6a108d802c0d5c7251a1897.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.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/reference_model/src/main.cpp b/reference_model/src/main.cpp
index 62b8f6f..3b84ff8 100644
--- a/reference_model/src/main.cpp
+++ b/reference_model/src/main.cpp
@@ -543,7 +543,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);