mirror of
https://github.com/VirusTotal/yara.git
synced 2026-10-12 02:10:00 +00:00
tests: Improve error message (#1265)
Co-authored-by: Victor M. Alvarez <[email protected]>
This commit is contained in:
co-authored by
Victor M. Alvarez
parent
09d095b1c8
commit
f5893ea78b
+6
-10
@@ -515,7 +515,7 @@ int matches_blob(
|
||||
|
||||
if (scan_result != ERROR_SUCCESS)
|
||||
{
|
||||
fprintf(stderr, "error: scan_result: %d\n", scan_result);
|
||||
fprintf(stderr, "failed to scan using rule << %s >>: error: %d\n", rule, scan_result);
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
@@ -592,16 +592,12 @@ int capture_string(char* rule, char* string, char* expected_string)
|
||||
f.found = 0;
|
||||
f.expected = expected_string;
|
||||
|
||||
if (yr_rules_scan_mem(
|
||||
rules,
|
||||
(uint8_t*) string,
|
||||
strlen(string),
|
||||
0,
|
||||
capture_matches,
|
||||
&f,
|
||||
0) != ERROR_SUCCESS)
|
||||
int scan_result = yr_rules_scan_mem(rules, (uint8_t*)string, strlen(string), 0,
|
||||
capture_matches, &f, 0);
|
||||
|
||||
if (scan_result != ERROR_SUCCESS)
|
||||
{
|
||||
fprintf(stderr, "yr_rules_scan_mem: error\n");
|
||||
fprintf(stderr, "failed to scan using rule << %s >>: error %d\n", rule, scan_result);
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user