diff --git a/src/compiler.c b/src/compiler.c index 79e9b20..69e4e02 100644 --- a/src/compiler.c +++ b/src/compiler.c @@ -110,7 +110,7 @@ static void print_ast_to_file(AST_NODE_PTR ast, TargetConfig *target) { return; // create file path to write graphviz to - const char *path = make_file_path(1, target->name, ".gv", target->archive_directory); + const char *path = make_file_path(target->name, ".gv", 1, target->archive_directory); FILE *output = fopen((const char *) path, "w"); if (output == NULL) { diff --git a/src/io/files.c b/src/io/files.c index 86cdfdb..0ea8993 100644 --- a/src/io/files.c +++ b/src/io/files.c @@ -326,7 +326,7 @@ const char *get_absolute_path(const char *path) { return strdup(absolute_path); } -const char* make_file_path(int count, const char* name, const char* ext, ...) { +const char* make_file_path(const char* name, const char* ext, int count, ...) { DEBUG("building file path..."); va_list args; diff --git a/src/io/files.h b/src/io/files.h index 7b8b166..61c7ebb 100644 --- a/src/io/files.h +++ b/src/io/files.h @@ -151,6 +151,6 @@ const char* get_absolute_path(const char* path); * @return A relative path of a file */ [[nodiscard("pointer must be freed")]] -const char* make_file_path(int count, const char* name, const char* ext, ...); +const char* make_file_path(const char* name, const char* ext, int count, ...); #endif //GEMSTONE_FILES_H