From eec6e04bd4ec4b5158ed126c11ce5e1da9d39a6f Mon Sep 17 00:00:00 2001 From: Kevin Day Date: Thu, 13 Jun 2024 22:24:33 -0500 Subject: [PATCH] Bugfix: Incorrect condition checks for wrap and replace parameters in iki_read. --- level_3/iki_read/c/main/common.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/level_3/iki_read/c/main/common.c b/level_3/iki_read/c/main/common.c index 96360f2..67eb536 100644 --- a/level_3/iki_read/c/main/common.c +++ b/level_3/iki_read/c/main/common.c @@ -190,8 +190,8 @@ extern "C" { return; } - if (main->program.parameters.array[iki_read_parameter_replace_e].result != f_console_result_none_e) { - if ((main->program.parameters.array[iki_read_parameter_replace_e].result & f_console_result_found_e) || main->program.parameters.array[iki_read_parameter_replace_e].values.used % 2) { + if (main->program.parameters.array[iki_read_parameter_replace_e].result & f_console_result_found_e) { + if (!(main->program.parameters.array[iki_read_parameter_replace_e].result & f_console_result_value_e) || (main->program.parameters.array[iki_read_parameter_replace_e].values.used % 2)) { main->setting.state.status = F_status_set_error(F_parameter); fll_program_print_error_parameter_missing_value_requires_amount(&main->program.error, f_console_symbol_long_normal_s, iki_read_long_replace_s, iki_read_string_two_s); @@ -273,8 +273,8 @@ extern "C" { if (F_status_is_error(main->setting.state.status)) return; - if (main->program.parameters.array[iki_read_parameter_wrap_e].result != f_console_result_none_e) { - if ((main->program.parameters.array[iki_read_parameter_wrap_e].result & f_console_result_found_e) || main->program.parameters.array[iki_read_parameter_wrap_e].values.used % 3) { + if (main->program.parameters.array[iki_read_parameter_wrap_e].result & f_console_result_found_e) { + if (!(main->program.parameters.array[iki_read_parameter_wrap_e].result & f_console_result_value_e) || (main->program.parameters.array[iki_read_parameter_wrap_e].values.used % 3)) { main->setting.state.status = F_status_set_error(F_parameter); fll_program_print_error_parameter_missing_value_requires_amount(&main->program.error, f_console_symbol_long_normal_s, iki_read_long_wrap_s, iki_read_string_three_s); -- 1.8.3.1