From: Kevin Day Date: Wed, 30 Mar 2022 03:37:07 +0000 (-0500) Subject: Bugfix: The out of range is printing and then continues processing. X-Git-Tag: 0.5.9~43 X-Git-Url: https://git.kevux.org/?a=commitdiff_plain;h=ba3646addcd9ef8eecae2fd2c73df54750309736;p=fll 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. --- 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 1000f1692..729541a1b 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 15e12292c..44e09e3bd 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)) {