]> 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 ef2a7f5..8b9b495 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 05871f0..f899d49 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 dd34548..309f614 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 cd810f6..74aaabb 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 6b058ab..868bfc7 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;