From 17b91a4f944f5eeb442f2123c5546c2e4ecc88bd Mon Sep 17 00:00:00 2001 From: zhuruigan Date: Wed, 28 Feb 2024 16:52:49 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=87=E4=BB=B6=E5=A4=84=E7=90=86=E5=85=BC?= =?UTF-8?q?=E5=AE=B9=E6=80=A7=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zhuruigan Change-Id: Ic1a9c50aae05a4d0cdd29f7b2b440e0fa05e548f --- utils/src/b_json/b_report_entity.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/utils/src/b_json/b_report_entity.cpp b/utils/src/b_json/b_report_entity.cpp index 5d4ac0826..118119cf6 100644 --- a/utils/src/b_json/b_report_entity.cpp +++ b/utils/src/b_json/b_report_entity.cpp @@ -45,7 +45,11 @@ const string INFO_SIZE = "size"; static vector SplitStringByChar(const string &str, const char &sep) { vector splits; - stringstream ss(str); + string newStr = str; + if (str.rfind(sep) == str.size() - 1) { + newStr += sep; + } + stringstream ss(newStr); string res; while (getline(ss, res, sep)) { splits.push_back(res); -- Gitee