From: Kevin Day Date: Fri, 7 Mar 2025 06:23:06 +0000 (-0600) Subject: Bugfix: Incorrect counter resets and related clean ups. X-Git-Url: https://git.kevux.org/?a=commitdiff_plain;h=98536e5b0540a96d0b4247b5ba078c266a2c594b;p=fll Bugfix: Incorrect counter resets and related clean ups. I overlooked some cases where the counter is not reset at the start of the loop. Do some variable clean ups for code following similar logic. --- diff --git a/level_3/fss_identify/c/main/common.c b/level_3/fss_identify/c/main/common.c index 06b5029..0dd0f8f 100644 --- a/level_3/fss_identify/c/main/common.c +++ b/level_3/fss_identify/c/main/common.c @@ -209,7 +209,7 @@ extern "C" { } // Construct the array without allocating any more memory by setting this as a static string (used > 0, size = 0). - for (f_number_unsigned_t index = 0; main->setting.files.used < parameters->remaining.used; ) { + for (index = 0; main->setting.files.used < parameters->remaining.used; ) { if (fss_identify_signal_check(main)) return; diff --git a/level_3/iki_read/c/eki/process.c b/level_3/iki_read/c/eki/process.c index 6823e5a..1208a88 100644 --- a/level_3/iki_read/c/eki/process.c +++ b/level_3/iki_read/c/eki/process.c @@ -641,7 +641,7 @@ extern "C" { : data->vocabularys.used; } else { - for (; i < data->delimits.used; ++i) { + for (i = 0; i < data->delimits.used; ++i) { main->cache.buffer.string[data->delimits.array[i]] = f_iki_syntax_placeholder_s.string[0]; } // for diff --git a/level_3/iki_read/c/iki/process.c b/level_3/iki_read/c/iki/process.c index f61530b..199c78f 100644 --- a/level_3/iki_read/c/iki/process.c +++ b/level_3/iki_read/c/iki/process.c @@ -592,7 +592,7 @@ extern "C" { : data->vocabulary.used; } else { - for (; i < data->delimits.used; ++i) { + for (i = 0; i < data->delimits.used; ++i) { main->cache.buffer.string[data->delimits.array[i]] = f_iki_syntax_placeholder_s.string[0]; } // for diff --git a/level_3/utf8/c/main/common.c b/level_3/utf8/c/main/common.c index 5468c61..04e1a14 100644 --- a/level_3/utf8/c/main/common.c +++ b/level_3/utf8/c/main/common.c @@ -201,6 +201,8 @@ extern "C" { main->setting.flag &= ~utf8_main_flag_file_to_d; } + f_number_unsigned_t index = 0; + if (parameters->array[utf8_parameter_from_file_e].result & f_console_result_value_e) { main->setting.path_files_from.used = 0; @@ -215,7 +217,6 @@ extern "C" { main->setting.path_files_from.used = parameters->array[utf8_parameter_from_file_e].values.used; f_number_unsigned_t i = 0; - f_number_unsigned_t index = 0; for (; i < main->setting.path_files_from.used; ++i) { @@ -275,7 +276,7 @@ extern "C" { } // Construct the array without allocating any more memory by setting this as a static string (used > 0, size = 0). - for (f_number_unsigned_t index = 0; main->setting.remaining.used < parameters->remaining.used; ) { + for (index = 0; main->setting.remaining.used < parameters->remaining.used; ) { index = parameters->remaining.array[main->setting.remaining.used];