]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
test-compress-benchmark: skip loop iteration if size is 0
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Sat, 5 Mar 2016 02:46:47 +0000 (21:46 -0500)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Sat, 5 Mar 2016 02:46:47 +0000 (21:46 -0500)
Otherwise we would hit an assert in the compression code.

src/journal/test-compress-benchmark.c

index 5b2d130cd6a685653bead43dfd2adceabda1ef8c..0ef6d36a507b577922e4815d2ccba27738a71da9 100644 (file)
@@ -105,6 +105,8 @@ static void test_compress_decompress(const char* label, const char* type,
                 int r;
 
                 size = permute(i);
+                if (size == 0)
+                        continue;
 
                 log_debug("%s %zu %zu", type, i, size);