From: Kevin Day Date: Thu, 15 Oct 2020 04:47:17 +0000 (-0500) Subject: Bugfix: invalid number check in FSS Extended List write program. X-Git-Tag: 0.5.1~28 X-Git-Url: https://git.kevux.org/?a=commitdiff_plain;h=44a8653845da05f9f0a9df75df7552de7dbd65ee;p=fll Bugfix: invalid number check in FSS Extended List write program. The range is inclusive and as such the stop point is not the same as the string size. Instead, it should be the string size minus one. --- diff --git a/level_3/fss_extended_list_write/c/private-fss_extended_list_write.c b/level_3/fss_extended_list_write/c/private-fss_extended_list_write.c index 171f848..4fcfc11 100644 --- a/level_3/fss_extended_list_write/c/private-fss_extended_list_write.c +++ b/level_3/fss_extended_list_write/c/private-fss_extended_list_write.c @@ -364,7 +364,7 @@ extern "C" { index = data.parameters[fss_extended_list_write_parameter_ignore].additional.array[i * 2]; range.start = 0; - range.stop = strnlen(arguments.argv[index], f_console_length_size); + range.stop = strnlen(arguments.argv[index], f_console_length_size) - 1; // allow and ignore the positive sign. if (range.stop > 0 && arguments.argv[index][0] == '+') { @@ -383,7 +383,7 @@ extern "C" { index = data.parameters[fss_extended_list_write_parameter_ignore].additional.array[(i * 2) + 1]; range.start = 0; - range.stop = strnlen(arguments.argv[index], f_console_length_size); + range.stop = strnlen(arguments.argv[index], f_console_length_size) - 1; // allow and ignore the positive sign. if (range.stop > 0 && arguments.argv[index][0] == '+') {