"doc/git@developer.sourcefind.cn:wangsen/paddle_dbnet.git" did not exist on "e33e38d1d0d4e49594c26ce86ceadc9e8ed52a19"
Commit 4df8a2ae authored by LDOUBLEV's avatar LDOUBLEV
Browse files

fix cpp bug

parent 8868d068
...@@ -21,12 +21,18 @@ std::vector<std::string> OCRConfig::split(const std::string &str, ...@@ -21,12 +21,18 @@ std::vector<std::string> OCRConfig::split(const std::string &str,
std::vector<std::string> res; std::vector<std::string> res;
if ("" == str) if ("" == str)
return res; return res;
char *strs = new char[str.length() + 1];
int strlen = str.length() + 1;
chars *strs = new char[strlen];
std::strcpy(strs, str.c_str()); std::strcpy(strs, str.c_str());
char *d = new char[delim.length() + 1]; int delimlen = delim.length() + 1;
char *d = new char[delimlen];
std::strcpy(d, delim.c_str()); std::strcpy(d, delim.c_str());
delete[] strs;
delete[] d;
char *p = std::strtok(strs, d); char *p = std::strtok(strs, d);
while (p) { while (p) {
std::string s = p; std::string s = p;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment