From 1a327b06ab4eb77a4df03fe7389b69e88b3c2a20 Mon Sep 17 00:00:00 2001 From: Yuxuan Shui Date: Fri, 8 Feb 2019 22:46:24 +0000 Subject: [PATCH] Fix abort because we used log too early Can't use log in get_early_config. Signed-off-by: Yuxuan Shui --- src/options.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/options.c b/src/options.c index d1b0378..23dc8eb 100644 --- a/src/options.c +++ b/src/options.c @@ -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; }