Skip to content
Snippets Groups Projects
Commit 773d4126 authored by William Roberts's avatar William Roberts
Browse files

check_seapp: Correct output on duplicate entries


If a duplicate entry is found, rule_map_cmp() incorrectly
assumes that the lengths of the key value pairs should be
equal, when this is not true. The duplicate detection is
done on the input parameters, thus the lengths can be
different. This resulted in a duplicate error string
message of "do not match", instead of "match on all inputs".

Also, the file name printed that contained the error was
the output file, not the input file that contained it.

Change-Id: I9b3f99fa4aa3454849de55f18b198b0b56e44320
Signed-off-by: default avatarWilliam Roberts <william.c.roberts@intel.com>
parent cc905d8c
No related branches found
No related tags found
No related merge requests found
...@@ -347,9 +347,6 @@ static map_match rule_map_cmp(rule_map *rmA, rule_map *rmB) { ...@@ -347,9 +347,6 @@ static map_match rule_map_cmp(rule_map *rmA, rule_map *rmB) {
key_map *mA; key_map *mA;
key_map *mB; key_map *mB;
if (rmA->length != rmB->length)
return map_no_matches;
for (i = 0; i < rmA->length; i++) { for (i = 0; i < rmA->length; i++) {
mA = &(rmA->m[i]); mA = &(rmA->m[i]);
...@@ -818,7 +815,7 @@ static void rule_add(rule_map *rm) { ...@@ -818,7 +815,7 @@ static void rule_add(rule_map *rm) {
cmp = rule_map_cmp(rm, tmp->r); cmp = rule_map_cmp(rm, tmp->r);
log_error("Duplicate line detected in file: %s\n" log_error("Duplicate line detected in file: %s\n"
"Lines %d and %d %s!\n", "Lines %d and %d %s!\n",
out_file_name, tmp->r->lineno, rm->lineno, in_file_name, tmp->r->lineno, rm->lineno,
map_match_str[cmp]); map_match_str[cmp]);
rule_map_free(rm, rule_map_destroy_key); rule_map_free(rm, rule_map_destroy_key);
goto err; goto err;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment