From: Kevin Day Date: Thu, 1 Sep 2022 02:38:01 +0000 (-0500) Subject: Bugfix: private_f_memory_structure_resize() is not returning the error status codes. X-Git-Tag: 0.6.1~10 X-Git-Url: https://git.kevux.org/?a=commitdiff_plain;h=b9e0fc8a5d7bdd6ab6659c38332d22baa11d88ae;p=fll Bugfix: private_f_memory_structure_resize() is not returning the error status codes. The private_f_memory_structure_adjust() function is returning error status code returned by private_f_memory_adjust(). The private_f_memory_structure_resize() is now changed to do the same thing as private_f_memory_structure_adjust() but with tbe status code returned by private_f_memory_resize(). --- diff --git a/level_0/f_memory/c/private-memory.c b/level_0/f_memory/c/private-memory.c index 7d057f8..8c32340 100644 --- a/level_0/f_memory/c/private-memory.c +++ b/level_0/f_memory/c/private-memory.c @@ -131,15 +131,16 @@ extern "C" { f_status_t private_f_memory_structure_resize(const size_t length_new, const size_t type_size, void ** const structure, f_array_length_t * const used, f_array_length_t * const size) { const f_status_t status = private_f_memory_resize(*size, length_new, type_size, structure); - if (F_status_is_error(status)) return status; - *size = length_new; + if (F_status_is_error_not(status)) { + *size = length_new; - if (*used > *size) { - *used = *size; + if (*used > *size) { + *used = *size; + } } - return F_none; + return status; } #endif // !defined(_di_memory_structure_decrease_by_) || !defined(_di_memory_structure_increase_) || !defined(_di_memory_structure_increase_by_) || !defined(_di_f_memory_structure_resize_)