vppinfra: fix format_table coverity warning 79/34079/4
authorFlorin Coras <fcoras@cisco.com>
Tue, 12 Oct 2021 15:45:46 +0000 (08:45 -0700)
committerDamjan Marion <dmarion@me.com>
Wed, 13 Oct 2021 14:30:14 +0000 (14:30 +0000)
Type: fix

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: Ida114ba35227f70ddd87cad791a21f186be1cba8

src/vppinfra/format_table.c

index b698cfd..8b218f5 100644 (file)
@@ -52,7 +52,7 @@ format_text_cell (table_t *t, u8 *s, table_cell_t *c, table_text_attr_t *def,
 {
   table_text_attr_t _a = {}, *a = &_a;
 
-  if (a == 0)
+  if (c == 0)
     return format (s, t->no_ansi ? "" : "\x1b[0m");
 
   clib_memcpy (a, def, sizeof (table_text_attr_t));