]> Kevux Git Server - fll/commitdiff
Update: Always ensure content size is 0 when content is not found.
authorKevin Day <thekevinday@gmail.com>
Wed, 3 Aug 2022 00:10:10 +0000 (19:10 -0500)
committerKevin Day <thekevinday@gmail.com>
Wed, 3 Aug 2022 00:10:10 +0000 (19:10 -0500)
level_2/fll_fss/c/fss/basic.c
level_2/fll_fss/c/fss/basic_list.c
level_2/fll_fss/c/fss/extended.c
level_2/fll_fss/c/fss/extended_list.c
level_2/fll_fss/c/fss/payload.c

index ef2a7f5e6ae86847ec102471652e143a685386de..8b9b495d811255eb36b02b1a17a2bb6c39016ad5 100644 (file)
@@ -88,6 +88,7 @@ extern "C" {
 
           break;
         }
+
       } while (status == F_fss_found_object_not);
 
       if (status == F_none_eos || status == F_none_stop) {
@@ -120,6 +121,11 @@ extern "C" {
       // When content is found, the range->start is incremented, if content is found at range->stop, then range->start will be > range.stop.
       if (range->start >= range->stop || range->start >= buffer.used) {
         if (status == F_fss_found_object || status == F_fss_found_content || status == F_fss_found_content_not || status == F_fss_found_object_content_not) {
+
+          if (status == F_fss_found_object_content_not) {
+            contents->array[contents->used].used = 0;
+          }
+
           ++objects->used;
           ++contents->used;
 
@@ -133,6 +139,10 @@ extern "C" {
         return F_none_stop;
       }
 
+      if (status == F_fss_found_object_content_not) {
+        contents->array[contents->used].used = 0;
+      }
+
       ++objects->used;
       ++contents->used;
 
index 05871f0df7b0c5003d60130eff8a1810bf500441..f899d498e5b59244f19106a9b7c03933524ac2f7 100644 (file)
@@ -74,6 +74,7 @@ extern "C" {
 
           break;
         }
+
       } while (status == F_fss_found_object_not);
 
       if (status == F_none_eos || status == F_none_stop) {
@@ -103,6 +104,11 @@ extern "C" {
 
         // When content is found, the range->start is incremented, if content is found at range->stop, then range->start will be > range.stop.
         if (status == F_fss_found_object || status == F_fss_found_content || status == F_fss_found_content_not || status == F_fss_found_object_content_not) {
+
+          if (status == F_fss_found_object_content_not) {
+            contents->array[contents->used].used = 0;
+          }
+
           ++objects->used;
           ++contents->used;
         }
@@ -112,6 +118,10 @@ extern "C" {
         return F_none_stop;
       }
 
+      if (status == F_fss_found_object_content_not) {
+        contents->array[contents->used].used = 0;
+      }
+
       ++objects->used;
       ++contents->used;
 
index dd34548afa2c615407b8faf3aae13f8810be8d93..309f6149006100abecdabdb1d5035ca3d4179ead 100644 (file)
@@ -148,6 +148,11 @@ extern "C" {
 
         // When content is found, the range->start is incremented, if content is found at range->stop, then range->start will be > range.stop.
         if (status == F_fss_found_object || status == F_fss_found_content || status == F_fss_found_content_not || status == F_fss_found_object_content_not || status == F_end_not_group) {
+
+          if (status == F_fss_found_object_content_not) {
+            contents->array[contents->used].used = 0;
+          }
+
           ++objects->used;
           ++contents->used;
 
@@ -171,6 +176,10 @@ extern "C" {
         return F_none_stop;
       }
 
+      if (status == F_fss_found_object_content_not) {
+        contents->array[contents->used].used = 0;
+      }
+
       ++objects->used;
       ++contents->used;
 
index cd810f6ff40260150a3ba4367ab77964026ce41e..74aaabb277dab5e928e4c62e988cc3648f33c185 100644 (file)
@@ -73,6 +73,7 @@ extern "C" {
 
           break;
         }
+
       } while (status == F_fss_found_object_not);
 
       if (status == F_none_eos || status == F_none_stop) {
@@ -102,6 +103,11 @@ extern "C" {
 
         // When content is found, the range->start is incremented, if content is found at range->stop, then range->start will be > range.stop.
         if (status == F_fss_found_object || status == F_fss_found_content || status == F_fss_found_content_not || status == F_fss_found_object_content_not) {
+
+          if (status == F_fss_found_object_content_not) {
+            contents->array[contents->used].used = 0;
+          }
+
           ++objects->used;
           ++contents->used;
         }
@@ -111,6 +117,10 @@ extern "C" {
         return F_none_stop;
       }
 
+      if (status == F_fss_found_object_content_not) {
+        contents->array[contents->used].used = 0;
+      }
+
       ++objects->used;
       ++contents->used;
 
index 6b058abaa8ef997969f9182b6779e21508a38e93..868bfc7c4eae9de74b11279767a19d9c6e31aa90 100644 (file)
@@ -113,7 +113,7 @@ extern "C" {
             status2 = f_string_ranges_increase(state.step_small, &contents->array[contents->used]);
             if (F_status_is_error(status2)) return status2;
 
-            ++contents->used;
+            contents->array[contents->used++].used = 0;
 
             return F_none;
           }
@@ -152,6 +152,11 @@ extern "C" {
 
         // When content is found, the range->start is incremented, if content is found at range->stop, then range->start will be > range.stop.
         if (status == F_fss_found_object || status == F_fss_found_content || status == F_fss_found_content_not || status == F_fss_found_object_content_not) {
+
+          if (status == F_fss_found_object_content_not) {
+            contents->array[contents->used].used = 0;
+          }
+
           ++objects->used;
           ++contents->used;
         }
@@ -162,6 +167,10 @@ extern "C" {
         return F_status_set_error(F_none_stop);
       }
 
+      if (status == F_fss_found_object_content_not) {
+        contents->array[contents->used].used = 0;
+      }
+
       ++objects->used;
       ++contents->used;