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

Update strend.c #68

Merged
merged 1 commit into from
Apr 1, 2024
Merged

Update strend.c #68

merged 1 commit into from
Apr 1, 2024

Conversation

sadeem-albir
Copy link
Contributor

By starting the comparison loop from '\0', you are making the t_length variable finish too early, leaving out the last letter unchecked for equality. Try 'printf("%d", strend("my cat", "dat"));' and you'll get an output of 1.

By starting the comparison loop from '\0', you are making the t_length variable finish too early, leaving out the last letter unchecked for equality. Try 'printf("%d", strend("my cat", "dat"));' and you'll get an output of 1.
@ohkimur
Copy link
Owner

ohkimur commented Apr 1, 2024

@sadeem-albir Thanks for the contribution!

@ohkimur ohkimur merged commit 5daa9d8 into ohkimur:main Apr 1, 2024
1 check passed
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