]> git.ipfire.org Git - telemetry.git/commitdiff
file: Only finish parsing when we have found enough fields
authorMichael Tremer <michael.tremer@ipfire.org>
Mon, 20 Oct 2025 13:25:37 +0000 (13:25 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Mon, 20 Oct 2025 13:25:37 +0000 (13:25 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/daemon/file.c

index 89b0280d14c9ee47fee88859ef261676c031b1cc..4780e734cb821a5814af288a92914d25db5dce6d 100644 (file)
@@ -263,9 +263,12 @@ static int __td_file_parse(td_ctx* ctx, td_file* self,
                if (r < 0)
                        return -errno;
 
+               // Continue if we could not match all fields
+               if (r < (int)p->n)
+                       continue;
+
                // If the field could be matched, we return
-               if (r == 1)
-                       return 0;
+               return 0;
        }
 
 #pragma GCC diagnostic pop