mirror of
https://github.com/FelixKratz/SketchyBar
synced 2024-11-10 05:44:16 +00:00
acquire realpath from user input
This commit is contained in:
parent
2306e34172
commit
e704e95d04
1 changed files with 8 additions and 2 deletions
|
@ -194,8 +194,14 @@ static void parse_arguments(int argc, char **argv) {
|
|||
if (argc < 3) {
|
||||
printf("[!] Error: Too few arguments for argument 'config'.\n");
|
||||
} else {
|
||||
snprintf(g_config_file, sizeof(g_config_file), "%s", argv[2]);
|
||||
return;
|
||||
char* path = realpath(argv[2], NULL);
|
||||
if (path) {
|
||||
snprintf(g_config_file, sizeof(g_config_file), "%s", path);
|
||||
free(path);
|
||||
return;
|
||||
}
|
||||
|
||||
printf("[!] Error: Specified config file path invalid.\n");
|
||||
}
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue