From: Kevin Day Date: Wed, 3 Aug 2022 00:13:15 +0000 (-0500) Subject: Bugfix: Content is incorrectly attempted to be processed even though it does not... X-Git-Url: https://git.kevux.org/?a=commitdiff_plain;h=5bef3f18d8f1977b4855cec224837988e2caf112;p=fll Bugfix: Content is incorrectly attempted to be processed even though it does not exist. There is happening due to a missing check to see if the Content array is empty. --- diff --git a/level_3/fake/c/private-make-load_fakefile.c b/level_3/fake/c/private-make-load_fakefile.c index 7aa7b3d..26e3372 100644 --- a/level_3/fake/c/private-make-load_fakefile.c +++ b/level_3/fake/c/private-make-load_fakefile.c @@ -172,28 +172,30 @@ extern "C" { data_make->id_main = data_make->fakefile.used; } - data_make->fakefile.array[data_make->fakefile.used].name = list_objects.array[i]; - delimits.used = 0; - content_range = list_contents.array[i].array[0]; + data_make->fakefile.array[data_make->fakefile.used].name = list_objects.array[i]; data_make->fakefile.array[data_make->fakefile.used].objects.used = 0; data_make->fakefile.array[data_make->fakefile.used].contents.used = 0; data_make->fakefile.array[data_make->fakefile.used].quotess.used = 0; - *status = fll_fss_extended_read(data_make->buffer, state, &content_range, &data_make->fakefile.array[data_make->fakefile.used].objects, &data_make->fakefile.array[data_make->fakefile.used].contents, 0, &data_make->fakefile.array[data_make->fakefile.used].quotess, &delimits, 0); + if (list_contents.array[i].used) { + content_range = list_contents.array[i].array[0]; - if (F_status_is_error(*status)) { - fake_print_error_fss(data_make->data, F_status_set_fine(*status), "fll_fss_extended_read", data_make->data->file_data_build_fakefile, content_range, F_true); + *status = fll_fss_extended_read(data_make->buffer, state, &content_range, &data_make->fakefile.array[data_make->fakefile.used].objects, &data_make->fakefile.array[data_make->fakefile.used].contents, 0, &data_make->fakefile.array[data_make->fakefile.used].quotess, &delimits, 0); - break; - } + if (F_status_is_error(*status)) { + fake_print_error_fss(data_make->data, F_status_set_fine(*status), "fll_fss_extended_read", data_make->data->file_data_build_fakefile, content_range, F_true); - *status = f_fss_apply_delimit(state, delimits, &data_make->buffer); + break; + } - if (F_status_is_error(*status)) { - fll_error_print(data_make->main->error, F_status_set_fine(*status), "f_fss_apply_delimit", F_true); + *status = f_fss_apply_delimit(state, delimits, &data_make->buffer); - break; + if (F_status_is_error(*status)) { + fll_error_print(data_make->main->error, F_status_set_fine(*status), "f_fss_apply_delimit", F_true); + + break; + } } ++data_make->fakefile.used;