Skip to content

Conversation

Tesla-J
Copy link

@Tesla-J Tesla-J commented Jun 26, 2025

This new test helps to check if allocated memory is excessive when we start close to the end of the string and len is less than the length of the string.

Previous tests do not take this in account, mbueno-g's test helped me to find this out.

Tesla-J added 2 commits June 26, 2025 16:10
New test for ft_substr — check allcocated memory size when: ft_strlen(s) <= len < ft_strlen(s)
Update ft_substr_test.cpp
@Tripouille
Copy link
Owner

Hey Tesla-J, thanks for your interest. Isn't that undefined behavior since the start is greater than the end? If so, it shouldn't be tested.

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