From fba63f5cdf56111bd088d4513295d439ee18a1d1 Mon Sep 17 00:00:00 2001 From: Prateek Sunal Date: Sun, 25 Aug 2024 23:49:44 +0530 Subject: [PATCH] fix(c): init logger before running parser --- src/ccextractor.c | 4 ++++ src/lib_ccx/lib_ccx.c | 4 ---- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/ccextractor.c b/src/ccextractor.c index c63e6d0ab..a8676405c 100644 --- a/src/ccextractor.c +++ b/src/ccextractor.c @@ -448,6 +448,10 @@ int main(int argc, char *argv[]) // If "ccextractor.cnf" is present, takes options from it. // See docs/ccextractor.cnf.sample for more info. +#ifndef DISABLE_RUST + ccxr_init_basic_logger(); +#endif + #ifndef DISABLE_RUST int compile_ret = ccxr_parse_parameters(argc, argv); #else diff --git a/src/lib_ccx/lib_ccx.c b/src/lib_ccx/lib_ccx.c index d0a69b469..4b137952e 100644 --- a/src/lib_ccx/lib_ccx.c +++ b/src/lib_ccx/lib_ccx.c @@ -102,10 +102,6 @@ struct lib_ccx_ctx *init_libraries(struct ccx_s_options *opt) ccx_common_logging.log_ftn = &mprint; ccx_common_logging.gui_ftn = &activity_library_process; -#ifndef DISABLE_RUST - ccxr_init_basic_logger(); -#endif - struct lib_ccx_ctx *ctx = malloc(sizeof(struct lib_ccx_ctx)); if (!ctx) ccx_common_logging.fatal_ftn(EXIT_NOT_ENOUGH_MEMORY, "init_libraries: Not enough memory allocating lib_ccx_ctx context.");