未验证 提交 d585f4c5 编写于 作者: D Double_V 提交者: GitHub

Merge pull request #3620 from LDOUBLEV/fix_cpp_22

fix cpp
......@@ -21,10 +21,12 @@ std::vector<std::string> OCRConfig::split(const std::string &str,
std::vector<std::string> res;
if ("" == str)
return res;
char strs[str.length() + 1];
int strlen = str.length() + 1;
char *strs = new char[strlen];
std::strcpy(strs, str.c_str());
char d[delim.length() + 1];
int delimlen = delim.length() + 1;
char *d = new char[delimlen];
std::strcpy(d, delim.c_str());
char *p = std::strtok(strs, d);
......@@ -34,6 +36,8 @@ std::vector<std::string> OCRConfig::split(const std::string &str,
p = std::strtok(NULL, d);
}
delete[] strs;
delete[] d;
return res;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册