From: Kevin Day Date: Fri, 14 Jun 2024 03:24:33 +0000 (-0500) Subject: Bugfix: Incorrect condition checks for wrap and replace parameters in iki_read. X-Git-Url: https://git.kevux.org/?a=commitdiff_plain;h=eec6e04bd4ec4b5158ed126c11ce5e1da9d39a6f;p=fll Bugfix: Incorrect condition checks for wrap and replace parameters in iki_read. --- 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);