Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix str[n]len implementations #39

Merged
merged 1 commit into from
Mar 1, 2024

Conversation

fischerling
Copy link
Contributor

The current implementations do not count the length of empty strings correctly.
The following buffer content "\0foo\0" is considered a string with length 4, because the iteration pointer is incremented before it is dereferenced to check for a null char.

Replace the broken strlen functions with the implementation of musl libc.

This fixes subtle bugs in the shell's code (e.g., cmd_put("\0");).

The current implementations do not count the length of empty strings
correctly.
The following buffer content "\0foo\0" is considered a string with
length 4, because the iteration pointer is incremented before
it is dereferenced to check for a null char.

Replace the broken strlen functions with the implementation of musl libc.
@Galfurian Galfurian merged commit 2df2f34 into mentos-team:develop Mar 1, 2024
17 checks passed
@Galfurian Galfurian added the bug Something isn't working label Mar 1, 2024
@fischerling fischerling deleted the fix-strlen branch March 14, 2024 17:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants