diff options
Diffstat (limited to 'main.c')
-rw-r--r-- | main.c | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -80,7 +80,7 @@ static int process_scriptbase_subdir(struct scriptbase *base, static int prepare_scriptbase_from_dir(const char *dir_path, struct scriptbase *base) { - DIR *maindir; + DIR *maindir = NULL; struct dirent *subdir; struct stringbuf path_buf; struct stringbuf json_buf; @@ -91,11 +91,11 @@ static int prepare_scriptbase_from_dir(const char *dir_path, stringbuf_init(&path_buf); stringbuf_init(&json_buf); - maindir = opendir(dir_path); - if (!maindir) + if (scriptbase_init(base, "https://hydrilla.koszko.org/resources")) goto end; - if (scriptbase_init(base, "https://hydrilla.koszko.org/resources")) + maindir = opendir(dir_path); + if (!maindir) goto end; if (sb_sprintf(&path_buf, "%s/", dir_path)) |