aboutsummaryrefslogtreecommitdiff
path: root/string/test-strpbrk.c
diff options
context:
space:
mode:
Diffstat (limited to 'string/test-strpbrk.c')
-rw-r--r--string/test-strpbrk.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/string/test-strpbrk.c b/string/test-strpbrk.c
index 77cf56dd16..a920c00041 100644
--- a/string/test-strpbrk.c
+++ b/string/test-strpbrk.c
@@ -97,7 +97,7 @@ do_test (size_t align, size_t pos, size_t len)
char *rej, *s;
align &= 7;
- if (align + pos >= page_size || len > 240)
+ if (align + pos + 10 >= page_size || len > 240)
return;
rej = buf2 + (random () & 255);
@@ -127,6 +127,12 @@ do_test (size_t align, size_t pos, size_t len)
}
}
s[pos] = rej[random () % (len + 1)];
+ if (s[pos])
+ {
+ for (i = pos + 1; i < pos + 10; ++i)
+ s[i] = random () & 255;
+ s[i] = '\0';
+ }
result = STRPBRK_RESULT (s, pos);
if (HP_TIMING_AVAIL)