Skip to content

Commit

Permalink
Merge pull request OpenSCAP#1289 from jan-cerny/pcre_exec_fail
Browse files Browse the repository at this point in the history
Improve error message for pcre_exec fail
  • Loading branch information
matejak authored Jan 21, 2019
2 parents 44ff324 + bfcb4d8 commit c3eab03
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/OVAL/results/oval_cmp_basic.c
Original file line number Diff line number Diff line change
Expand Up @@ -135,8 +135,8 @@ static oval_result_t strregcomp(const char *pattern, const char *test_str)

re = pcre_compile(pattern, PCRE_UTF8, &err, &errofs, NULL);
if (re == NULL) {
dE("Unable to compile regex pattern, "
"pcre_compile() returned error (offset: %d): '%s'.\n", errofs, err);
dE("Unable to compile regex pattern '%s', "
"pcre_compile() returned error (offset: %d): '%s'.\n", pattern, errofs, err);
return OVAL_RESULT_ERROR;
}

Expand All @@ -146,8 +146,8 @@ static oval_result_t strregcomp(const char *pattern, const char *test_str)
} else if (ret == -1) {
result = OVAL_RESULT_FALSE;
} else {
dE("Unable to match regex pattern, "
"pcre_exec() returned error: %d.\n", ret);
dE("Unable to match regex pattern '%s' on string '%s', "
"pcre_exec() returned error: %d.\n", pattern, test_str, ret);
result = OVAL_RESULT_ERROR;
}

Expand Down

0 comments on commit c3eab03

Please sign in to comment.