Fix abort because we used log too early

Can't use log in get_early_config.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
This commit is contained in:
Yuxuan Shui 2019-02-08 22:46:24 +00:00
parent 343140f845
commit 1a327b06ab
No known key found for this signature in database
GPG Key ID: 37C999F617EA1A47
1 changed files with 6 additions and 2 deletions

View File

@ -510,8 +510,12 @@ bool get_early_config(int argc, char *const *argv, char **config_file, bool *all
}
// Check for abundant positional arguments
if (optind < argc)
log_fatal("compton doesn't accept positional arguments.");
if (optind < argc) {
// log is not initialized here yet
fprintf(stderr, "compton doesn't accept positional arguments.\n");
*exit_code = 1;
return true;
}
return false;
}