- [FIX] Arreglats dos posibles errors de desbordament
This commit is contained in:
1 parent
5a0c4a0ba7
commit
538bc143f8
2 files changed
+8
-18
No files matched your search
@@ -66,25 +66,14 @@ int add_cpp(const std::string& name) {
|
||||
|
||||
bool contains(const std::vector<std::string>& v, const std::string& s) { return std::find(v.begin(), v.end(), s) != v.end(); }
|
||||
|
||||
std::vector<std::string> split(std::string str)
|
||||
std::vector<std::string> split(const std::string& str)
|
||||
{
|
||||
std::vector<std::string> strings;
|
||||
char tmp[100];
|
||||
int tmp_p = 0, str_p = 0;
|
||||
while (str[str_p]!=0)
|
||||
{
|
||||
if (str[str_p]!=32)
|
||||
tmp[tmp_p++] = str[str_p++];
|
||||
else
|
||||
{
|
||||
tmp[tmp_p]=0;
|
||||
strings.push_back(tmp);
|
||||
tmp_p=0; while (str[str_p]==32) str_p++;
|
||||
std::stringstream ss(str);
|
||||
std::string token;
|
||||
while (ss >> token) {
|
||||
strings.push_back(token);
|
||||
}
|
||||
}
|
||||
tmp[tmp_p]=0;
|
||||
strings.push_back(tmp);
|
||||
|
||||
return strings;
|
||||
}
|
||||
|
||||
@@ -473,7 +462,8 @@ std::cout << " |___/ v" << LAGUEIRTO_VERSION << std::endl;
|
||||
exit(1);
|
||||
}
|
||||
} else {
|
||||
std::string path = "." + folder_char + src_path;
|
||||
std::filesystem::path path = src_path;
|
||||
//std::string path = "." + folder_char + src_path;
|
||||
|
||||
if (recursive) {
|
||||
for (const auto &entry : std::filesystem::recursive_directory_iterator(path)) {
|
||||
|
||||
Reference in new issue
Block a user