Skip to content

Commit

Permalink
Safely join paths in main.cpp.
Browse files Browse the repository at this point in the history
  • Loading branch information
1uc committed Oct 2, 2024
1 parent 0c90584 commit 36b8208
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -406,11 +406,9 @@ int run_nmodl(int argc, const char* argv[]) {
ast_to_nmodl(*ast, filepath("ast"));

if (json_ast) {
std::string file{scratch_dir};
file += "/";
file += modfile;
file += ".ast.json";
logger->info("Writing AST into {}", file);
std::filesystem::path file{scratch_dir};
file /= modfile + ".ast.json";
logger->info("Writing AST into {}", file.string());
JSONVisitor(file).write(*ast);
}

Expand Down

0 comments on commit 36b8208

Please sign in to comment.