"...git@developer.sourcefind.cn:wangsen/paddle_dbnet.git" did not exist on "29976de4eb50625fa0796e8ecb110dcc8524884d"
Unverified Commit 0bf4fc37 authored by Double_V's avatar Double_V Committed by GitHub
Browse files

Merge pull request #3619 from LDOUBLEV/fix_cpp

fix cpp
parents 411d764c 005a0b82
...@@ -23,16 +23,13 @@ std::vector<std::string> OCRConfig::split(const std::string &str, ...@@ -23,16 +23,13 @@ std::vector<std::string> OCRConfig::split(const std::string &str,
return res; return res;
int strlen = str.length() + 1; int strlen = str.length() + 1;
chars *strs = new char[strlen]; char *strs = new char[strlen];
std::strcpy(strs, str.c_str()); std::strcpy(strs, str.c_str());
int delimlen = delim.length() + 1; int delimlen = delim.length() + 1;
char *d = new char[delimlen]; 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;
...@@ -40,6 +37,9 @@ std::vector<std::string> OCRConfig::split(const std::string &str, ...@@ -40,6 +37,9 @@ std::vector<std::string> OCRConfig::split(const std::string &str,
p = std::strtok(NULL, d); p = std::strtok(NULL, d);
} }
delete[] strs;
delete[] d;
return res; return res;
} }
......
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