From ba3646addcd9ef8eecae2fd2c73df54750309736 Mon Sep 17 00:00:00 2001 From: Kevin Day Date: Tue, 29 Mar 2022 22:37:07 -0500 Subject: [PATCH] Bugfix: The out of range is printing and then continues processing. When out of range happens an error should be printed and should stop processing for that parameter. This is not happening because the status is incorrectly being returned when status is not assigned an error bit. The out of range check happens independent of the status variable. --- level_3/fss_status_code/c/private-fss_status_code.c | 2 +- level_3/status_code/c/private-status_code.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/level_3/fss_status_code/c/private-fss_status_code.c b/level_3/fss_status_code/c/private-fss_status_code.c index 1000f16..729541a 100644 --- a/level_3/fss_status_code/c/private-fss_status_code.c +++ b/level_3/fss_status_code/c/private-fss_status_code.c @@ -144,7 +144,7 @@ extern "C" { if (*number > F_status_size_max_with_bits_d) { fl_print_format("%[out of range%]%r", main->output.to.stream, main->context.set.error, main->context.set.error, f_string_eol_s); - return status; + return F_status_set_error(F_number_overflow); } if (F_status_is_error(status)) { diff --git a/level_3/status_code/c/private-status_code.c b/level_3/status_code/c/private-status_code.c index 15e1229..44e09e3 100644 --- a/level_3/status_code/c/private-status_code.c +++ b/level_3/status_code/c/private-status_code.c @@ -136,7 +136,7 @@ extern "C" { if (*number > F_status_size_max_with_bits_d) { fl_print_format("%[out of range%]%r", main->output.to.stream, main->context.set.error, main->context.set.error, f_string_eol_s); - return status; + return F_status_set_error(F_number_overflow); } if (F_status_is_error(status)) { -- 1.8.3.1