]> git.ipfire.org Git - people/ric9/pakfire.git/commitdiff
log buffer: Since length is signed, we cannot assign -1
authorMichael Tremer <michael.tremer@ipfire.org>
Tue, 24 Dec 2024 13:39:59 +0000 (13:39 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Tue, 24 Dec 2024 13:39:59 +0000 (13:39 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/libpakfire/log_buffer.c
tests/libpakfire/log_buffer.c

index 1852e6f0d7ec0db145fa30cca00fc00ad1c7098f..1e1c63dda3e6300db67f5856983bd52d6bcefafb 100644 (file)
@@ -161,7 +161,7 @@ int pakfire_log_buffer_dequeue(struct pakfire_log_buffer* buffer, int* priority,
                *line = NULL;
 
                if (length)
-                       *length = -1;
+                       *length = 0;
 
                return 0;
        }
index 834cbb8222891ca4d64f9d1e2e963c52cbe0d587..12228b30969350d73f8c8474db2660582b0e5976 100644 (file)
@@ -65,7 +65,7 @@ static int test_simple(const struct test* t) {
 
        ASSERT_EQUALS(priority, -1);
        ASSERT_EQUALS(line, NULL);
-       ASSERT_EQUALS(length, -1);
+       ASSERT_EQUALS(length, 0);
 
        // Everything passed
        r = EXIT_SUCCESS;