diff options
author | Louie S <louie@example.com> | 2023-02-23 20:02:35 -0800 |
---|---|---|
committer | Louie S <louie@example.com> | 2023-02-23 20:02:35 -0800 |
commit | 01d60765f8441e5d81e7c02770731af8c0676c21 (patch) | |
tree | e1a3bfefe7c00d83b474f20a283547bf7a2de636 /src/unix/read_cfg.c | |
parent | d6709baba9c8d1c082116dccdd5e75c2c58288fc (diff) |
Fix first boot crash on unix
Diffstat (limited to 'src/unix/read_cfg.c')
-rw-r--r-- | src/unix/read_cfg.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/unix/read_cfg.c b/src/unix/read_cfg.c index 4d98c82..b40dd48 100644 --- a/src/unix/read_cfg.c +++ b/src/unix/read_cfg.c @@ -24,7 +24,7 @@ char *find_config(){ sprintf(choices[1], "%s%c.terminal-media-launcher%cconfig", home, sep, sep); for(i = 0; i < check_count; i++){ - path = choices[i]; + strcpy(path, choices[i]); printf("Checking for config at %s: ", choices[i]); if(access(path, R_OK) == 0){ printf("Using config \"%s\"\n\n", path); @@ -33,9 +33,8 @@ char *find_config(){ else printf("File does not exist\n"); } - //TODO no config exists, ask user if they want to autogenerate one mkconfig_wizard(choices[0]); - path = choices[0]; + strcpy(path, choices[0]); return path; } @@ -185,7 +184,7 @@ void handle_fname(char *path, char *group, bool recurs, bool force, char *name, //the directory is real if(dp != NULL){ - while(fname = readdir(dp)){ + while((fname = readdir(dp))){ relative_path_cpy[0] = '\0'; strcat(relative_path_cpy, dirname); strcat(relative_path_cpy, fname->d_name); |