]> Kevux Git Server - fll/commitdiff
Bugfix: private_f_memory_structure_resize() is not returning the error status codes.
authorKevin Day <thekevinday@gmail.com>
Thu, 1 Sep 2022 02:38:01 +0000 (21:38 -0500)
committerKevin Day <thekevinday@gmail.com>
Thu, 1 Sep 2022 02:38:01 +0000 (21:38 -0500)
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

index 7d057f83fd1616058ce48d993dcd0515a995712c..8c3234044878982cfa80916237b9a58982f22cfe 100644 (file)
@@ -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_)