Skip to content

Commit

Permalink
initialize files earlier
Browse files Browse the repository at this point in the history
  • Loading branch information
mptre committed Apr 13, 2024
1 parent 34fc6d1 commit 366019f
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions knfmt.c
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ int
main(int argc, char *argv[])
{
struct main_context c = {0};
struct files files;
struct files files = {0};
const char *clang_format = NULL;
size_t i;
int error = 0;
Expand Down Expand Up @@ -103,6 +103,9 @@ main(int argc, char *argv[])
if (c.options.diffparse)
diff_init();

if (VECTOR_INIT(files.fs_vc))
err(1, NULL);

c.arena.eternal = arena_alloc();
arena_scope(c.arena.eternal, eternal_scope);
c.arena.scratch = arena_alloc();
Expand Down Expand Up @@ -137,8 +140,6 @@ main(int argc, char *argv[])
goto out;
}

if (VECTOR_INIT(files.fs_vc))
err(1, NULL);
if (filelist(argc, argv, &files, &eternal_scope, c.arena.scratch,
&c.options)) {
error = 1;
Expand Down

0 comments on commit 366019f

Please sign in to comment.