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 Visual Studio throwing C4996 warning in ustring.cpp. #33731

Merged
merged 1 commit into from
Feb 11, 2020

Conversation

madmiraal
Copy link
Contributor

Fixes Visual Studio throwing a C4996 warning: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead at core\ustring.cpp(147).

Also ensures that resizing the storage was successful before trying to copy the data.

It doesn't address the fact that resize() takes an int and len is a size_t or unsigned long, or that len may wrap around when incrementing, but that's for another day.

core/ustring.cpp Outdated Show resolved Hide resolved
@akien-mga akien-mga requested a review from hpvb November 22, 2019 08:14
@akien-mga akien-mga added this to the 4.0 milestone Nov 22, 2019
@akien-mga akien-mga merged commit 0b4b248 into godotengine:master Feb 11, 2020
@akien-mga
Copy link
Member

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants