summaryrefslogtreecommitdiff
path: root/runner/resultgen.c
diff options
context:
space:
mode:
Diffstat (limited to 'runner/resultgen.c')
-rw-r--r--runner/resultgen.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/runner/resultgen.c b/runner/resultgen.c
index b74970a6..bccfca12 100644
--- a/runner/resultgen.c
+++ b/runner/resultgen.c
@@ -481,12 +481,15 @@ static int find_subtest_idx_limited(struct matches matches,
if (line_len < 0)
return -1;
- for (k = first; k < last; k++)
+ for (k = first; k < last; k++) {
+ ptrdiff_t rem = bufend - matches.items[k].where;
+
if (matches.items[k].what == linekey &&
!memcmp(matches.items[k].where,
full_line,
- min(line_len, bufend - matches.items[k].where)))
+ min_t(ptrdiff_t, line_len, rem)))
break;
+ }
free(full_line);