Skip to content

Conversation

@ncruces
Copy link
Contributor

@ncruces ncruces commented Jul 11, 2025

Continuing #580. strchrnul is used by strchr, strcspn and many other places in libc. The implementation is a matchup between strlen and memchr.

@ncruces
Copy link
Contributor Author

ncruces commented Jul 15, 2025

The test for memchr needed a fix: the unsigned to signed pos < length + 2 comparison meant that, depending on compile flags, the inner loop might not run.

@abrown abrown merged commit 4525255 into WebAssembly:main Jul 17, 2025
17 checks passed
ncruces added a commit to ncruces/wasi-libc that referenced this pull request Jul 18, 2025
Continuing WebAssembly#580. `strchrnul` is used by `strchr`, `strcspn` and many
other places in libc. The implementation is a matchup between `strlen`
and `memchr`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants