From 44a8653845da05f9f0a9df75df7552de7dbd65ee Mon Sep 17 00:00:00 2001 From: Kevin Day Date: Wed, 14 Oct 2020 23:47:17 -0500 Subject: [PATCH] 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. --- level_3/fss_extended_list_write/c/private-fss_extended_list_write.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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] == '+') { -- 1.8.3.1