diff options
Diffstat (limited to 'tools')
-rw-r--r-- | tools/klee/main.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/tools/klee/main.cpp b/tools/klee/main.cpp index ab9dfe28..1178c9cf 100644 --- a/tools/klee/main.cpp +++ b/tools/klee/main.cpp @@ -546,11 +546,11 @@ void KleeHandler::getKTestFilesInDir(std::string directoryPath, #else std::error_code ec; #endif - for (llvm::sys::fs::directory_iterator i(directoryPath, ec), e; i != e && !ec; - i.increment(ec)) { - std::string f = (*i).path(); - if (f.substr(f.size()-6,f.size()) == ".ktest") { - results.push_back(f); + llvm::sys::fs::directory_iterator i(directoryPath, ec), e; + for (; i != e && !ec; i.increment(ec)) { + auto f = i->path(); + if (f.size() >= 6 && f.substr(f.size()-6,f.size()) == ".ktest") { + results.push_back(f); } } |