]> Kevux Git Server - fll/commitdiff
Bugfix: Increasing strings by too much.
authorKevin Day <thekevinday@gmail.com>
Sat, 26 Mar 2022 16:22:39 +0000 (11:22 -0500)
committerKevin Day <thekevinday@gmail.com>
Sat, 26 Mar 2022 16:22:39 +0000 (11:22 -0500)
The *_increase_by() methods already include the ".used" length.
The previous code is also adding the ".used" length resulting in an increase of ".used" * 2.

level_1/fl_fss/c/fss/basic.c
level_1/fl_fss/c/fss/basic_list.c
level_1/fl_fss/c/fss/embedded_list.c
level_1/fl_fss/c/fss/extended_list.c
level_1/fl_fss/c/private-fss.c

index 3eb7591..ec38918 100644 (file)
@@ -181,7 +181,7 @@ extern "C" {
     }
 
     // Ensure that there is room for the potential terminating newline.
-    status = f_string_dynamic_increase_by(destination->used + (range->stop - range->start) + 1, destination);
+    status = f_string_dynamic_increase_by((range->stop - range->start) + 1, destination);
     if (F_status_is_error(status)) return status;
 
     const f_array_length_t destination_used = destination->used;
index 770d784..0617ff1 100644 (file)
@@ -585,7 +585,7 @@ extern "C" {
     }
 
     // Ensure that there is room for a slash delimit, the object open character, and the end of line character.
-    status = f_string_dynamic_increase_by(destination->used + (range->stop - range->start) + 3, destination);
+    status = f_string_dynamic_increase_by((range->stop - range->start) + 3, destination);
     if (F_status_is_error(status)) return status;
 
     const f_array_length_t used_start = destination->used;
@@ -799,7 +799,7 @@ extern "C" {
     }
 
     // Ensure that there is room for a slash delimit and possibly the end of content character.
-    status = f_string_dynamic_increase_by(destination->used + (range->stop - range->start) + 2, destination);
+    status = f_string_dynamic_increase_by((range->stop - range->start) + 2, destination);
     if (F_status_is_error(status)) return status;
 
     const f_array_length_t used_start = destination->used;
index e6b9efe..fd66083 100644 (file)
@@ -1001,7 +1001,7 @@ extern "C" {
     }
 
     // Ensure that there is room for a slash delimit, the object open character, and the end of line character.
-    status = f_string_dynamic_increase_by(destination->used + (range->stop - range->start) + 3, destination);
+    status = f_string_dynamic_increase_by((range->stop - range->start) + 3, destination);
     if (F_status_is_error(status)) return status;
 
     const f_array_length_t used_start = destination->used;
@@ -1237,7 +1237,7 @@ extern "C" {
     }
 
     // Ensure that there is room for a slash delimit and possibly the end of content characters.
-    status = f_string_dynamic_increase_by(destination->used + (range->stop - range->start) + 3, destination);
+    status = f_string_dynamic_increase_by((range->stop - range->start) + 3, destination);
     if (F_status_is_error(status)) return status;
 
     const f_array_length_t used_start = destination->used;
index 3cb33a1..6c93dc8 100644 (file)
@@ -548,7 +548,7 @@ extern "C" {
     }
 
     // Ensure that there is room for a slash delimit, the object open character, and the end of line character.
-    status = f_string_dynamic_increase_by(destination->used + (range->stop - range->start) + 3, destination);
+    status = f_string_dynamic_increase_by((range->stop - range->start) + 3, destination);
     if (F_status_is_error(status)) return status;
 
     const f_array_length_t used_start = destination->used;
@@ -784,7 +784,7 @@ extern "C" {
     }
 
     // Ensure that there is room for a slash delimit and possibly the end of content characters.
-    status = f_string_dynamic_increase_by(destination->used + (range->stop - range->start) + 3, destination);
+    status = f_string_dynamic_increase_by((range->stop - range->start) + 3, destination);
     if (F_status_is_error(status)) return status;
 
     const f_array_length_t used_start = destination->used;
index 79c0a42..7da2ef0 100644 (file)
@@ -856,7 +856,7 @@ extern "C" {
     }
 
     // Ensure that there is room for the potential start and stop quotes, a potential delimit at start, and the potential object open character.
-    status = f_string_dynamic_increase_by(destination->used + (range->stop - range->start) + 4, destination);
+    status = f_string_dynamic_increase_by((range->stop - range->start) + 4, destination);
     if (F_status_is_error(status)) return status;
 
     const f_array_length_t input_start = range->start;