Fix: sink.text.pretty: Unsigned compared against 0
authorFrancis Deslauriers <francis.deslauriers@efficios.com>
Mon, 6 May 2019 19:04:05 +0000 (15:04 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Tue, 7 May 2019 16:09:58 +0000 (12:09 -0400)
  CID 1401251 (#1 of 1): Unsigned compared against 0 (NO_EFFECT)
  unsigned_compare: This less-than-zero comparison of an unsigned value is
  never true. nr_fields < 0UL.

Reported-by: Coverity (1401251) Unsigned compared against 0
Signed-off-by: Francis Deslauriers <francis.deslauriers@efficios.com>
Change-Id: I8aa8a03a6b03ca1640570d70a51729d001af3b66
Reviewed-on: https://review.lttng.org/c/babeltrace/+/1263
Reviewed-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
plugins/text/pretty/print.c

index 95189d5e2fda7df18fea904cf87d6d2d4a173248..a53a567f080807189da974f648016acdee8541ff 100644 (file)
@@ -822,11 +822,9 @@ int print_struct(struct pretty_component *pretty,
                ret = -1;
                goto end;
        }
+
        nr_fields = bt_field_class_structure_get_member_count(struct_class);
-       if (nr_fields < 0) {
-               ret = -1;
-               goto end;
-       }
+
        g_string_append(pretty->string, "{");
        pretty->depth++;
        nr_printed_fields = 0;
This page took 0.027455 seconds and 4 git commands to generate.