From 614a911397f138eee6a108d802c0d5c7251a1897 Mon Sep 17 00:00:00 2001 From: TatWai Chong Date: Thu, 2 Nov 2023 00:52:57 -0700 Subject: [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 --- reference_model/src/main.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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 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); -- cgit v1.2.1