Skip to content

Commit

Permalink
ofp-table: Fix count_common_prefix_run() function.
Browse files Browse the repository at this point in the history
It appears that an issue existed in the count_common_prefix_run()
function from the beginning. This problem came to light while
addressing 'Dead assignment' warnings identified by the Clang
static analyzer.

Instead of updating the extra_prefix_len with the current (next)
value, the next value was inadvertently updated with extra_prefix_len.
This patch rectifies this behavior.

Fixes: 95a5454 ("ofp-print: Abbreviate lists of fields in table features output.")
Signed-off-by: Eelco Chaudron <[email protected]>
Acked-by: Ilya Maximets <[email protected]>
Signed-off-by: Simon Horman <[email protected]>
  • Loading branch information
chaudron authored and Simon Horman committed Oct 30, 2023
1 parent 07e3598 commit 3919e61
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/ofp-table.c
Original file line number Diff line number Diff line change
Expand Up @@ -1416,7 +1416,7 @@ count_common_prefix_run(const char *ids[], size_t n,
if (!next) {
break;
} else if (next < extra_prefix_len) {
next = extra_prefix_len;
extra_prefix_len = next;
}
i++;
}
Expand Down

0 comments on commit 3919e61

Please sign in to comment.