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

Remove last uses of hsStrcpy and hsStrncpy #1657

Merged
merged 3 commits into from
Jan 27, 2025

Conversation

dgelessus
Copy link
Contributor

Most calls to these functions have already been removed in previous ST::string/Unicode conversion work. This PR takes care of the last few remaining uses and finally drops these custom functions (in favor of ST::string and standard C APIs).

Important difference: hsStrncpy always ensured that the destination string is 0-terminated, whereas the standard C strncpy will not add a 0 terminator if the destination buffer is too small to hold the entire source string. So we do lose this convenience/safety feature by switching to standard functions. But considering that (after this PR) the codebase only contains 12 strncpy calls in total, I don't think hsStrncpy is worth keeping around (especially not in the HeadSpin.h header that's included almost everywhere).

@Hoikas Hoikas merged commit 361393e into H-uru:master Jan 27, 2025
17 checks passed
@dgelessus dgelessus deleted the remove_hsstrcpy branch January 27, 2025 00:59
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.

3 participants