From 89da1e2ef720365aebf5166c1a2d3f579456d08e Mon Sep 17 00:00:00 2001 From: "Ralf W. Grosse-Kunstleve" Date: Sun, 14 Jul 2024 01:12:43 -0700 Subject: [PATCH] Use `memcpy` instead of `strcpy` to resolve MSVC errors. --- tests/test_class_sh_property_bakein.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/test_class_sh_property_bakein.cpp b/tests/test_class_sh_property_bakein.cpp index 0fae55101..6063aab5a 100644 --- a/tests/test_class_sh_property_bakein.cpp +++ b/tests/test_class_sh_property_bakein.cpp @@ -1,9 +1,11 @@ #include "pybind11_tests.h" +#include + namespace test_class_sh_property_bakein { struct WithCharArrayMember { - WithCharArrayMember() { std::strcpy(char6_member, "Char6"); } + WithCharArrayMember() { std::memcpy(char6_member, "Char6", 6); } char char6_member[6]; };