diff options
| author | tim <> | 2026-06-23 13:10:40 +0000 |
|---|---|---|
| committer | tim <> | 2026-06-23 13:10:40 +0000 |
| commit | f9707f7b963592168658da6ac5ca59ddd3d9e967 (patch) | |
| tree | bb029290d2ff7655e41ae96153c1567a6c73d720 /src/lib/libc/string | |
| parent | 2e2e484ec4991ae53dfe018edc48fdfedaf31ec2 (diff) | |
| download | openbsd-f9707f7b963592168658da6ac5ca59ddd3d9e967.tar.gz openbsd-f9707f7b963592168658da6ac5ca59ddd3d9e967.tar.bz2 openbsd-f9707f7b963592168658da6ac5ca59ddd3d9e967.zip | |
Fix misleading comment in strstr(3)
From upstream musl:
https://git.musl-libc.org/cgit/musl/commit?id=c53e9b239418eb3e0e8be256abd0f6ad7608bbcf
OK tb@
Diffstat (limited to 'src/lib/libc/string')
| -rw-r--r-- | src/lib/libc/string/strstr.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/lib/libc/string/strstr.c b/src/lib/libc/string/strstr.c index 06795d9838..f5f460a251 100644 --- a/src/lib/libc/string/strstr.c +++ b/src/lib/libc/string/strstr.c | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | /* $OpenBSD: strstr.c,v 1.10 2026/06/23 13:09:11 tim Exp $ */ | 1 | /* $OpenBSD: strstr.c,v 1.11 2026/06/23 13:10:40 tim Exp $ */ |
| 2 | 2 | ||
| 3 | /* | 3 | /* |
| 4 | * Copyright (c) 2005-2018 Rich Felker | 4 | * Copyright (c) 2005-2018 Rich Felker |
| @@ -129,7 +129,7 @@ twoway_strstr(const unsigned char *h, const unsigned char *n) | |||
| 129 | for (;;) { | 129 | for (;;) { |
| 130 | /* Update incremental end-of-haystack pointer */ | 130 | /* Update incremental end-of-haystack pointer */ |
| 131 | if (z-h < l) { | 131 | if (z-h < l) { |
| 132 | /* Fast estimate for MIN(l,63) */ | 132 | /* Fast estimate for MAX(l,63) */ |
| 133 | size_t grow = l | 63; | 133 | size_t grow = l | 63; |
| 134 | const unsigned char *z2 = memchr(z, 0, grow); | 134 | const unsigned char *z2 = memchr(z, 0, grow); |
| 135 | if (z2) { | 135 | if (z2) { |
