From b9e0fc8a5d7bdd6ab6659c38332d22baa11d88ae Mon Sep 17 00:00:00 2001 From: Kevin Day Date: Wed, 31 Aug 2022 21:38:01 -0500 Subject: [PATCH] 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(). --- level_0/f_memory/c/private-memory.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) 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_) -- 1.8.3.1