Use memcpy instead of strcpy to resolve MSVC errors.

This commit is contained in:
Ralf W. Grosse-Kunstleve 2024-07-14 01:12:43 -07:00
parent c65d5dfaa8
commit 89da1e2ef7

View File

@ -1,9 +1,11 @@
#include "pybind11_tests.h" #include "pybind11_tests.h"
#include <cstring>
namespace test_class_sh_property_bakein { namespace test_class_sh_property_bakein {
struct WithCharArrayMember { struct WithCharArrayMember {
WithCharArrayMember() { std::strcpy(char6_member, "Char6"); } WithCharArrayMember() { std::memcpy(char6_member, "Char6", 6); }
char char6_member[6]; char char6_member[6];
}; };