1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-09 12:50:35 +00:00

Merge pull request #33731 from madmiraal/fix-c4996-warning

Fix Visual Studio throwing C4996 warning in ustring.cpp.
This commit is contained in:
Rémi Verschelde
2020-02-11 10:22:36 +01:00
committed by GitHub

View File

@@ -146,9 +146,11 @@ void CharString::copy_from(const char *p_cstr) {
return; return;
} }
resize(len + 1); // include terminating null char Error err = resize(++len); // include terminating null char
strcpy(ptrw(), p_cstr); ERR_FAIL_COND_MSG(err != OK, "Failed to copy C-string.");
memcpy(ptrw(), p_cstr, len);
} }
void String::copy_from(const char *p_cstr) { void String::copy_from(const char *p_cstr) {